mirror of
https://github.com/Smaug123/ray-tracing-fsharp
synced 2025-10-10 14:28:40 +00:00
Parallelise, allow us to write out partial progress, add a few more object types (#3)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user