Parallelise, allow us to write out partial progress, add a few more object types (#3)

This commit is contained in:
Patrick Stevens
2021-04-11 13:40:23 +01:00
committed by GitHub
parent a001bab92b
commit 136eecc6f2
20 changed files with 951 additions and 426 deletions

View File

@@ -11,7 +11,7 @@ module TestSphere =
let ``Point at distance r from centre lies on sphere`` () =
let property (centre : Point, radius : float, point : Point) : bool =
let radius = abs radius
let sphere = Sphere.make (SphereStyle.PureReflection (1.0, Colour.White)) centre radius
let sphere = Sphere.make (SphereStyle.PureReflection (1.0<albedo>, Colour.White)) centre radius
Sphere.liesOn point sphere
@@ -27,14 +27,11 @@ module TestSphere =
|> Gen.map NormalFloat.op_Explicit
let surfacePoint =
[|
radius * cos phi * sin theta
radius * sin phi * sin theta
radius * cos theta
|]
|> Point
|> Point.difference centre
|> fun (Vector v) -> Point v
Point.make
(radius * cos phi * sin theta)
(radius * sin phi * sin theta)
(radius * cos theta)
|> fun p -> Point.sum centre p
return centre, radius, surfacePoint
}