Algosim documentation: AreParallel

AreParallel

Checks if two vectors are parallel.

Syntax

Description

If u and v are vectors of the same dimension, then AreParallel(u, v) is true iff u and v are parallel, that is, iff there exists a scalar κ such that u = κ⋅v or v = κ⋅u. The specified value of ε will be used as the epsilon for floating-point comparisons. If not specified, a default epsilon will be used.

Notes

The infix operator is implemented by the AreParallel function. This operator doesn’t support a custom epsilon.

Examples

❨−27.6, 40.8, −18❩ ∥ ❨2.3, −3.4, 1.5❩
true
AreParallel(❨1, 2, 3❩, ❨10, 20, 30.0001❩, 1E−3)
true

See also