Beta

Details of an N-Dimensional Hyperrectangle

Description:

What is a hyperrectangle?
A hyperrectangle is a generalisation of a rectangle into higher or lower dimensions.

Examples of hyperrectangles

  • A hyperrectangle in 2 dimensions would be a rectangle
    • its hyperperimeter would be a rectangle's perimeter
    • its hyperarea would be its area.
  • A hyperrectangle in 3 dimensions would be a cuboid
    • its hyperperimeter would be its surface area
    • its hyperarea would be its volume.
  • A hyperectangle in 4 dimensions
    • its hyperperimeter would be its surface volume
    • its hyperarea that would be its hypervolume.

Your Goal
Write a function that takes in the sides of an n-dimensional hyperrectangle as an array of length n, each item representing a length of the hyperrectangle, and outputs its associated hyperarea and hyperperimeter in a tuple of length 2

Technicalities

  • Assume a point (0-dimensional shape) has a hyperarea of None and a hyperperimeter of None
  • Assume a line (1-dimensional shape) has a hyperarea of its length and a hyperperimeter of None
Geometry
Puzzles

More By Author:

Check out these other kata created by Joe Reece

Stats:

CreatedJan 7, 2022
PublishedJan 8, 2022
Warriors Trained92
Total Skips30
Total Code Submissions107
Total Times Completed35
Python Completions35
Total Stars2
% of votes with a positive feedback rating86% of 18
Total "Very Satisfied" Votes14
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes1
Total Rank Assessments18
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Joe Reece Avatar
Ad