Table of Contents

Class LinearAlgebraAssertions

Namespace
MathAssertions.TUnit
Assembly
MathAssertions.TUnit.dll

Fluent LinearAlgebra assertions for Vector3 pair properties and Vector3-array linear independence. Matrix-side invariants live on MatrixAssertions.

public static class LinearAlgebraAssertions
Inheritance
LinearAlgebraAssertions
Inherited Members

Methods

AreLinearlyIndependent(Vector3[], double)

Asserts the supplied vectors are linearly independent in R^3 within tolerance. Spans of four or more vectors are always dependent.

[GenerateAssertion(ExpectationMessage = "to be linearly independent within tolerance {tolerance}", InlineMethodBody = false)]
public static bool AreLinearlyIndependent(this Vector3[] value, double tolerance)

Parameters

value Vector3[]
tolerance double

Returns

bool

HasAngleBetweenApproximately(Vector3, Vector3, double, double)

Asserts the angle between value and other is within tolerance of expectedRadians. The angle is the unsigned angle on [0, pi], computed via atan2(|u x v|, u . v) for numerical accuracy.

[GenerateAssertion(ExpectationMessage = "to have an angle of {expectedRadians} rad to {other} within tolerance {tolerance}", InlineMethodBody = true)]
public static bool HasAngleBetweenApproximately(this Vector3 value, Vector3 other, double expectedRadians, double tolerance)

Parameters

value Vector3
other Vector3
expectedRadians double
tolerance double

Returns

bool

IsOrthogonalTo(Vector3, Vector3, double)

Asserts value and other are orthogonal within tolerance.

[GenerateAssertion(ExpectationMessage = "to be orthogonal to {other} within tolerance {tolerance}", InlineMethodBody = true)]
public static bool IsOrthogonalTo(this Vector3 value, Vector3 other, double tolerance)

Parameters

value Vector3
other Vector3
tolerance double

Returns

bool

IsParallelTo(Vector3, Vector3, double)

Asserts value and other are parallel within tolerance.

[GenerateAssertion(ExpectationMessage = "to be parallel to {other} within tolerance {tolerance}", InlineMethodBody = true)]
public static bool IsParallelTo(this Vector3 value, Vector3 other, double tolerance)

Parameters

value Vector3
other Vector3
tolerance double

Returns

bool