feat: Initial commit

This commit is contained in:
2024-05-24 16:44:41 -04:00
commit c1741de3f9
19 changed files with 1560 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import Foundation
public enum PlenumDimension: Equatable {
case rectangular(width: Double, height: Double)
case round(Double)
public var areaInSquareFeet: Double {
switch self {
case .rectangular(width: let width, height: let height):
return (width * height) / 144
case let .round(dimension):
return pow((dimension / 12) / 2, 2) * Double.pi
}
}
public enum Key: String, Equatable, CaseIterable, CustomStringConvertible {
case rectangular, round
public var description: String { rawValue.capitalized }
}
public var key: Key {
switch self {
case .rectangular:
return .rectangular
case .round:
return .round
}
}
}