Assert.Equal(a, A.M11)
Assert.Equal(b, A.M12)
Assert.Equal(c, A.M13)
- Assert.Equal((float32)0, A.M14)
+ Assert.Equal(0.0f, A.M14)
Assert.Equal(d, A.M21)
Assert.Equal(e, A.M22)
Assert.Equal(f, A.M23)
- Assert.Equal((float32)0, A.M24)
+ Assert.Equal(0.0f, A.M24)
Assert.Equal(g, A.M31)
Assert.Equal(h, A.M32)
Assert.Equal(i, A.M33)
- Assert.Equal((float32)0, A.M34)
+ Assert.Equal(0.0f, A.M34)
- Assert.Equal((float32)0, A.M41)
- Assert.Equal((float32)0, A.M42)
- Assert.Equal((float32)0, A.M43)
- Assert.Equal((float32)1, A.M44)
+ Assert.Equal(0.0f, A.M41)
+ Assert.Equal(0.0f, A.M42)
+ Assert.Equal(0.0f, A.M43)
+ Assert.Equal(1.0f, A.M44)
[<Property>]
let ``Four-vector4 constructor sets all components to the correct values`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) =
[<Property>]
let ``Vector inequality operator is by component`` (x, y) =
let v1 = Vector2(x, y)
- let v2 = Vector2(x + (float32)1 , y + (float32)1)
+ let v2 = Vector2(x + 1.0f , y + 1.0f)
let inequality = v1 <> v2
Assert.True(inequality)
//
[<Property>]
let ``Transformation by quaternion is the same as multiplication by quaternion and its conjugate`` (v : Vector2, q : Quaternion) =
- let vectorQuat = Quaternion(v.X, v.Y, (float32)0, (float32)0)
+ let vectorQuat = Quaternion(v.X, v.Y, 0.0f, 0.0f)
let inverse = Quaternion.Invert(q)
let transformedQuat = q * vectorQuat * inverse
[<Property>]
let ``Transformation by quaternion by reference is the same as multiplication by quaternion and its conjugate`` (v : Vector2, q : Quaternion) =
- let vectorQuat = Quaternion(v.X, v.Y, (float32)0, (float32)0)
+ let vectorQuat = Quaternion(v.X, v.Y, 0.0f, 0.0f)
let inverse = Quaternion.Invert(q)
let transformedQuat = q * vectorQuat * inverse
Assert.Equal(a, v2.X)
Assert.Equal(b, v2.Y)
- Assert.Equal((float32)0, v2.Z)
+ Assert.Equal(0.0f, v2.Z)
[<Property>]
let ``Vector3 value constructor sets all components to the correct values`` (a, b, c) =
[<Property>]
let ``Vector inequality operator is by component`` (x, y, z) =
let v1 = Vector3(x, y, z)
- let v2 = Vector3(x + (float32)1 , y + (float32)1, z + (float32)1)
+ let v2 = Vector3(x + 1.0f , y + 1.0f, z + 1.0f)
let inequality = v1 <> v2
Assert.True(inequality)
//
[<Property>]
let ``Unit X is correct`` =
- let unitX = Vector3((float32)1, (float32)0, (float32)0)
+ let unitX = Vector3(1.0f, 0.0f, 0.0f)
Assert.Equal(Vector3.UnitX, unitX)
[<Property>]
let ``Unit Y is correct`` =
- let unitY = Vector3((float32)0, (float32)1, (float32)0)
+ let unitY = Vector3(0.0f, 1.0f, 0.0f)
Assert.Equal(Vector3.UnitY, unitY)
[<Property>]
let ``Unit Z is correct`` =
- let unitZ = Vector3((float32)0, (float32)0, (float32)1)
+ let unitZ = Vector3(0.0f, 0.0f, 1.0f)
Assert.Equal(Vector3.UnitZ, unitZ)
[<Property>]
let ``Unit zero is correct`` =
- let unitZero = Vector3((float32)0, (float32)0, (float32)0)
+ let unitZero = Vector3(0.0f, 0.0f, 0.0f)
Assert.Equal(Vector3.Zero, unitZero)
let inverse = Quaternion.Invert(q)
let transformedQuat = q * vectorQuat * inverse
- let transformedVector = Vector3(transformedQuat.X, transformedQuat.Y, transformedQuat.Z)
+ let transformedVector = transformedQuat.Xyz
Assert.Equal(transformedVector, Vector3.Transform(v, q))
let inverse = Quaternion.Invert(q)
let transformedQuat = q * vectorQuat * inverse
- let transformedVector = Vector3(transformedQuat.X, transformedQuat.Y,transformedQuat.Z)
+ let transformedVector = transformedQuat.Xyz
Assert.Equal(transformedVector, Vector3.Transform(ref v, ref q))
\ No newline at end of file
Assert.Equal(x, v2.X)
Assert.Equal(y, v2.Y)
- Assert.Equal((float32)0, v2.Z)
- Assert.Equal((float32)0, v2.W)
+ Assert.Equal(0.0f, v2.Z)
+ Assert.Equal(0.0f, v2.W)
[<Property>]
let ``Vector3 value constructor sets all components to the correct values`` (x, y, z) =
Assert.Equal(x, v2.X)
Assert.Equal(y, v2.Y)
Assert.Equal(z, v2.Z)
- Assert.Equal((float32)0, v2.W)
+ Assert.Equal(0.0f, v2.W)
[<Property>]
let ``Vector3 value and scalar constructor sets all components to the correct values`` (x, y, z, w) =
[<Property>]
let ``Vector inequality operator is by component`` (x, y, z, w) =
let v1 = Vector4(x, y, z, w)
- let v2 = Vector4(x + (float32)1 , y + (float32)1, z + (float32)1, w + (float32)1)
+ let v2 = Vector4(x + 1.0f , y + 1.0f, z + 1.0f, w + 1.0f)
let inequality = v1 <> v2
Assert.True(inequality)
//
[<Property>]
let ``Unit X is correct`` =
- let unitX = Vector4((float32)1, (float32)0, (float32)0, (float32)0)
+ let unitX = Vector4(1.0f, 0.0f, 0.0f, 0.0f)
Assert.Equal(Vector4.UnitX, unitX)
[<Property>]
let ``Unit Y is correct`` =
- let unitY = Vector4((float32)0, (float32)1, (float32)0, (float32)0)
+ let unitY = Vector4(0.0f, 1.0f, 0.0f, 0.0f)
Assert.Equal(Vector4.UnitY, unitY)
[<Property>]
let ``Unit Z is correct`` =
- let unitZ = Vector4((float32)0, (float32)0, (float32)1, (float32)0)
+ let unitZ = Vector4(0.0f, 0.0f, 1.0f, 0.0f)
Assert.Equal(Vector4.UnitZ, unitZ)
[<Property>]
let ``Unit W is correct`` =
- let unitW = Vector4((float32)0, (float32)0, (float32)0, (float32)1)
+ let unitW = Vector4(0.0f, 0.0f, 0.0f, 1.0f)
Assert.Equal(Vector4.UnitW, unitW)
[<Property>]
let ``Unit zero is correct`` =
- let unitZero = Vector4((float32)0, (float32)0, (float32)0, (float32)0)
+ let unitZero = Vector4(0.0f, 0.0f, 0.0f, 0.0f)
Assert.Equal(Vector4.Zero, unitZero)
[<Property>]
let ``Unit one is correct`` =
- let unitOne = Vector4((float32)1, (float32)1, (float32)1, (float32)1)
+ let unitOne = Vector4(1.0f, 1.0f, 1.0f, 1.0f)
Assert.Equal(Vector4.One, unitOne)