diff --git a/nalgebra-glm/src/common.rs b/nalgebra-glm/src/common.rs index 83f9f33a..d072a4da 100644 --- a/nalgebra-glm/src/common.rs +++ b/nalgebra-glm/src/common.rs @@ -141,7 +141,7 @@ pub fn max2(x: &Vec, y: N) -> Vec x.map(|x| na::sup(&x, &y)) } -/// Componentwise maximum between `x` and `y`. +/// Component-wise maximum between `x` and `y`. pub fn max3(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { na::sup(x, y) @@ -158,7 +158,7 @@ pub fn min2(x: &Vec,y: N) -> Vec x.map(|x| na::inf(&x, &y)) } -/// Componentwise minimum between `x` and `y`. +/// Component-wise minimum between `x` and `y`. pub fn min3(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { na::inf(x, y) @@ -171,7 +171,7 @@ pub fn mix(x: N, y: N, a: N) -> N { x * (N::one() - a) + y * a } -/// Componentwise modulus. +/// Component-wise modulus. /// /// Returns `x - y * floor(x / y)` for each component in `x` using the corresponding component of `y`. pub fn mod_(x: &Vec, y: &Vec) -> Vec @@ -184,7 +184,7 @@ pub fn modf(x: N, i: N) -> N { x % i } -/// Componentwise rounding. +/// Component-wise rounding. /// /// Values equal to `0.5` are rounded away from `0.0`. pub fn round(x: &Vec) -> Vec diff --git a/nalgebra-glm/src/exponential.rs b/nalgebra-glm/src/exponential.rs index 67d0f1dc..70f0cdcd 100644 --- a/nalgebra-glm/src/exponential.rs +++ b/nalgebra-glm/src/exponential.rs @@ -2,13 +2,13 @@ use na::{Real, DefaultAllocator}; use aliases::Vec; use traits::{Alloc, Dimension}; -/// Componentwise exponential. +/// Component-wise exponential. pub fn exp(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.exp()) } -/// Componentwise base-2 exponential. +/// Component-wise base-2 exponential. pub fn exp2(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.exp2()) @@ -21,25 +21,25 @@ pub fn inversesqrt(v: &Vec) -> Vec } -/// Componentwise logarithm. +/// Component-wise logarithm. pub fn log(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.ln()) } -/// Componentwise base-2 logarithm. +/// Component-wise base-2 logarithm. pub fn log2(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.log2()) } -/// Componentwise power. +/// Component-wise power. pub fn pow(base: &Vec, exponent: &Vec) -> Vec where DefaultAllocator: Alloc { base.zip_map(exponent, |b, e| b.powf(e)) } -/// Componentwise square root. +/// Component-wise square root. pub fn sqrt(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| x.sqrt()) diff --git a/nalgebra-glm/src/ext/vector_common.rs b/nalgebra-glm/src/ext/vector_common.rs index a97062dd..e0f0c1f3 100644 --- a/nalgebra-glm/src/ext/vector_common.rs +++ b/nalgebra-glm/src/ext/vector_common.rs @@ -3,49 +3,49 @@ use na::{self, DefaultAllocator}; use traits::{Alloc, Number, Dimension}; use aliases::Vec; -/// Componentwise maximum between a vector and a scalar. +/// Component-wise maximum between a vector and a scalar. pub fn max(a: &Vec, b: N) -> Vec where DefaultAllocator: Alloc { a.map(|a| na::sup(&a, &b)) } -/// Componentwise maximum between two vectors. +/// Component-wise maximum between two vectors. pub fn max2(a: &Vec, b: &Vec) -> Vec where DefaultAllocator: Alloc { na::sup(a, b) } -/// Componentwise maximum between three vectors. +/// Component-wise maximum between three vectors. pub fn max3(a: &Vec, b: &Vec, c: &Vec) -> Vec where DefaultAllocator: Alloc { max2(&max2(a, b), c) } -/// Componentwise maximum between four vectors. +/// Component-wise maximum between four vectors. pub fn max4(a: &Vec, b: &Vec, c: &Vec, d: &Vec) -> Vec where DefaultAllocator: Alloc { max2(&max2(a, b), &max2(c, d)) } -/// Componentwise maximum between a vector and a scalar. +/// Component-wise maximum between a vector and a scalar. pub fn min(x: &Vec, y: N) -> Vec where DefaultAllocator: Alloc { x.map(|x| na::inf(&x, &y)) } -/// Componentwise maximum between two vectors. +/// Component-wise maximum between two vectors. pub fn min2(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { na::inf(x, y) } -/// Componentwise maximum between three vectors. +/// Component-wise maximum between three vectors. pub fn min3(a: &Vec, b: &Vec, c: &Vec) -> Vec where DefaultAllocator: Alloc { min2(&min2(a, b), c) } -/// Componentwise maximum between four vectors. +/// Component-wise maximum between four vectors. pub fn min4(a: &Vec, b: &Vec, c: &Vec, d: &Vec) -> Vec where DefaultAllocator: Alloc { min2(&min2(a, b), &min2(c, d)) diff --git a/nalgebra-glm/src/gtc/epsilon.rs b/nalgebra-glm/src/gtc/epsilon.rs index 91ba8503..b66ed4c0 100644 --- a/nalgebra-glm/src/gtc/epsilon.rs +++ b/nalgebra-glm/src/gtc/epsilon.rs @@ -4,24 +4,24 @@ use na::DefaultAllocator; use traits::{Alloc, Number, Dimension}; use aliases::Vec; -/// Componentwise approximate equality beween two vectors. +/// Component-wise approximate equality beween two vectors. pub fn epsilon_equal(x: &Vec, y: &Vec, epsilon: N) -> Vec where DefaultAllocator: Alloc { x.zip_map(y, |x, y| abs_diff_eq!(x, y, epsilon = epsilon)) } -/// Componentwise approximate equality beween two scalars. +/// Component-wise approximate equality beween two scalars. pub fn epsilon_equal2>(x: N, y: N, epsilon: N) -> bool { abs_diff_eq!(x, y, epsilon = epsilon) } -/// Componentwise approximate non-equality beween two vectors. +/// Component-wise approximate non-equality beween two vectors. pub fn epsilon_not_equal(x: &Vec, y: &Vec, epsilon: N) -> Vec where DefaultAllocator: Alloc { x.zip_map(y, |x, y| abs_diff_ne!(x, y, epsilon = epsilon)) } -/// Componentwise approximate non-equality beween two scalars. +/// Component-wise approximate non-equality beween two scalars. pub fn epsilon_not_equal2>(x: N, y: N, epsilon: N) -> bool { abs_diff_ne!(x, y, epsilon = epsilon) } diff --git a/nalgebra-glm/src/matrix.rs b/nalgebra-glm/src/matrix.rs index d3dcd64d..13c04f27 100644 --- a/nalgebra-glm/src/matrix.rs +++ b/nalgebra-glm/src/matrix.rs @@ -15,7 +15,7 @@ pub fn inverse(m: &Mat) -> Mat m.clone().try_inverse().unwrap_or(Mat::::zeros()) } -/// Componentwise multiplication of two matrices. +/// Component-wise multiplication of two matrices. pub fn matrix_comp_mult(x: &Mat, y: &Mat) -> Mat where DefaultAllocator: Alloc { x.component_mul(y) diff --git a/nalgebra-glm/src/quat/gtc_quaternion.rs b/nalgebra-glm/src/quat/gtc_quaternion.rs index f8729391..1bdd8ecc 100644 --- a/nalgebra-glm/src/quat/gtc_quaternion.rs +++ b/nalgebra-glm/src/quat/gtc_quaternion.rs @@ -10,22 +10,22 @@ pub fn euler_angles(x: &Qua) -> Vec { Vector3::new(a.2, a.1, a.0) } -/// Componentwise `>` comparison between two quaternions. +/// Component-wise `>` comparison between two quaternions. pub fn greater_than(x: &Qua, y: &Qua) -> Vec { ::greater_than(&x.coords, &y.coords) } -/// Componentwise `>=` comparison between two quaternions. +/// Component-wise `>=` comparison between two quaternions. pub fn greater_than_equal(x: &Qua, y: &Qua) -> Vec { ::greater_than_equal(&x.coords, &y.coords) } -/// Componentwise `<` comparison between two quaternions. +/// Component-wise `<` comparison between two quaternions. pub fn less_than(x: &Qua, y: &Qua) -> Vec { ::less_than(&x.coords, &y.coords) } -/// Componentwise `<=` comparison between two quaternions. +/// Component-wise `<=` comparison between two quaternions. pub fn less_than_equal(x: &Qua, y: &Qua) -> Vec { ::less_than_equal(&x.coords, &y.coords) } diff --git a/nalgebra-glm/src/quat/quaternion_relational.rs b/nalgebra-glm/src/quat/quaternion_relational.rs index 50541455..cdf95dc5 100644 --- a/nalgebra-glm/src/quat/quaternion_relational.rs +++ b/nalgebra-glm/src/quat/quaternion_relational.rs @@ -3,22 +3,22 @@ use na::{Real, U4}; use aliases::{Qua, Vec}; -/// Componentwise equality comparison between two quaternions. +/// Component-wise equality comparison between two quaternions. pub fn equal(x: &Qua, y: &Qua) -> Vec { ::equal(&x.coords, &y.coords) } -/// Componentwise approximate equality comparison between two quaternions. +/// Component-wise approximate equality comparison between two quaternions. pub fn equal_eps(x: &Qua, y: &Qua, epsilon: N) -> Vec { ::equal_eps(&x.coords, &y.coords, epsilon) } -/// Componentwise non-equality comparison between two quaternions. +/// Component-wise non-equality comparison between two quaternions. pub fn not_equal(x: &Qua, y: &Qua) -> Vec { ::not_equal(&x.coords, &y.coords) } -/// Componentwise approximate non-equality comparison between two quaternions. +/// Component-wise approximate non-equality comparison between two quaternions. pub fn not_equal_eps(x: &Qua, y: &Qua, epsilon: N) -> Vec { ::not_equal_eps(&x.coords, &y.coords, epsilon) } diff --git a/nalgebra-glm/src/trigonometric.rs b/nalgebra-glm/src/trigonometric.rs index 71673f29..d6b64653 100644 --- a/nalgebra-glm/src/trigonometric.rs +++ b/nalgebra-glm/src/trigonometric.rs @@ -4,91 +4,91 @@ use aliases::Vec; use traits::{Alloc, Dimension}; -/// Componentwise arc-cosinus. +/// Component-wise arc-cosinus. pub fn acos(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.acos()) } -/// Componentwise hyperbolic arc-cosinus. +/// Component-wise hyperbolic arc-cosinus. pub fn acosh(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.acosh()) } -/// Componentwise arc-sinus. +/// Component-wise arc-sinus. pub fn asin(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.asin()) } -/// Componentwise hyperbolic arc-sinus. +/// Component-wise hyperbolic arc-sinus. pub fn asinh(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.asinh()) } -/// Componentwise arc-tangent of `y / x`. +/// Component-wise arc-tangent of `y / x`. pub fn atan2(y: &Vec, x: &Vec) -> Vec where DefaultAllocator: Alloc { y.zip_map(x, |y, x| y.atan2(x)) } -/// Componentwise arc-tangent. +/// Component-wise arc-tangent. pub fn atan(y_over_x: &Vec) -> Vec where DefaultAllocator: Alloc { y_over_x.map(|e| e.atan()) } -/// Componentwise hyperbolic arc-tangent. +/// Component-wise hyperbolic arc-tangent. pub fn atanh(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.atanh()) } -/// Componentwise cosinus. +/// Component-wise cosinus. pub fn cos(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.cos()) } -/// Componentwise hyperbolic cosinus. +/// Component-wise hyperbolic cosinus. pub fn cosh(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.cosh()) } -/// Componentwise conversion from radians to degrees. +/// Component-wise conversion from radians to degrees. pub fn degrees(radians: &Vec) -> Vec where DefaultAllocator: Alloc { radians.map(|e| e * na::convert(180.0) / N::pi()) } -/// Componentwise conversion fro degrees to radians. +/// Component-wise conversion fro degrees to radians. pub fn radians(degrees: &Vec) -> Vec where DefaultAllocator: Alloc { degrees.map(|e| e * N::pi() / na::convert(180.0)) } -/// Componentwise sinus. +/// Component-wise sinus. pub fn sin(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.sin()) } -/// Componentwise hyperbolic sinus. +/// Component-wise hyperbolic sinus. pub fn sinh(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.sinh()) } -/// Componentwise tangent. +/// Component-wise tangent. pub fn tan(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.tan()) } -/// Componentwise hyperbolic tangent. +/// Component-wise hyperbolic tangent. pub fn tanh(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.tanh()) diff --git a/nalgebra-glm/src/vector_relational.rs b/nalgebra-glm/src/vector_relational.rs index e414dd27..00934621 100644 --- a/nalgebra-glm/src/vector_relational.rs +++ b/nalgebra-glm/src/vector_relational.rs @@ -15,43 +15,43 @@ pub fn any(v: &Vec) -> bool v.iter().any(|x| *x) } -/// Componentwise equality comparison. +/// Component-wise equality comparison. pub fn equal(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { x.zip_map(y, |x, y| x == y) } -/// Componentwise `>` comparison. +/// Component-wise `>` comparison. pub fn greater_than(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { x.zip_map(y, |x, y| x > y) } -/// Componentwise `>=` comparison. +/// Component-wise `>=` comparison. pub fn greater_than_equal(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { x.zip_map(y, |x, y| x >= y) } -/// Componentwise `<` comparison. +/// Component-wise `<` comparison. pub fn less_than(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { x.zip_map(y, |x, y| x < y) } -/// Componentwise `>=` comparison. +/// Component-wise `>=` comparison. pub fn less_than_equal(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { x.zip_map(y, |x, y| x <= y) } -/// Componentwise not `!`. +/// Component-wise not `!`. pub fn not(v: &Vec) -> Vec where DefaultAllocator: Alloc { v.map(|x| !x) } -/// Componentwise not-equality `!=`. +/// Component-wise not-equality `!=`. pub fn not_equal(x: &Vec, y: &Vec) -> Vec where DefaultAllocator: Alloc { x.zip_map(y, |x, y| x != y)