mirror of
https://github.com/Smaug123/ray-tracing-fsharp
synced 2025-10-10 14:28:40 +00:00
Moveable camera
This commit is contained in:
@@ -11,10 +11,13 @@ module TestPlane =
|
||||
let ``Orthogonalise does make orthogonal vectors`` () =
|
||||
let property (p : Plane) : bool =
|
||||
let orth = Plane.orthonormalise p |> Option.get
|
||||
let v1, v2 = Plane.basis orth
|
||||
Float.equal (UnitVector.dot (Ray.vector v1) (Ray.vector v2)) 0.0
|
||||
&& Float.equal (UnitVector.dot (Ray.vector v1) (Ray.vector v1)) 1.0
|
||||
&& Float.equal (UnitVector.dot (Ray.vector v2) (Ray.vector v2)) 1.0
|
||||
let v1, v2 = Plane.basis (Vector.make 0.0 1.0 0.0) orth
|
||||
let dotVectors = UnitVector.dot (Ray.vector v1) (Ray.vector v2)
|
||||
let v1Length = UnitVector.dot (Ray.vector v1) (Ray.vector v1)
|
||||
let v2Length = UnitVector.dot (Ray.vector v2) (Ray.vector v2)
|
||||
Float.equal dotVectors 0.0
|
||||
&& Float.equal v1Length 1.0
|
||||
&& Float.equal v2Length 1.0
|
||||
|
||||
property
|
||||
|> Prop.forAll (Arb.fromGen TestUtils.planeGen)
|
||||
|
Reference in New Issue
Block a user