Skip to content

kirkbyo/SciSwift

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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