Skip to content

Dimensionally homogenous calculations at compile time

Notifications You must be signed in to change notification settings

kirkbyo/SciSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SciSwift

Metric Units

Basic Usages

import SciSwift

let L1 = 10.0 [m]
let L2 = 5.0 [m]
print(L1 - L2) // 5.0 [m]

let velocity1 = 12 [m/s]
let velocity2 = 18 [km/h]
print(velocity2 - velocity1) // 6 [km/h]

func circumference(radius: SciValue<SI.distance>) -> SciValue<SI.distance> {
    return 2 * Double.pi * radius
}

print(circumference(radius: 1 [m]))

About

Dimensionally homogenous calculations at compile time

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages