Remove redundant access to vector curve coords

This commit is contained in:
Hanno Braun 2022-02-20 12:41:03 +01:00
parent ab19d3f72a
commit 71f62809c5
4 changed files with 3 additions and 10 deletions

View File

@ -65,7 +65,7 @@ impl Circle {
/// Convert a vector on the curve into model coordinates
pub fn vector_curve_to_model(&self, point: &Vector<1>) -> Vector<3> {
let radius = self.radius.magnitude();
let angle = point.t();
let angle = point.t;
let (sin, cos) = angle.sin_cos();

View File

@ -53,7 +53,7 @@ impl Line {
/// Convert a vector on the curve into model coordinates
pub fn vector_curve_to_model(&self, point: &Vector<1>) -> Vector<3> {
self.direction * point.t()
self.direction * point.t
}
}

View File

@ -58,7 +58,7 @@ impl<const D: usize> Point<D> {
impl Point<1> {
/// Access the curve point's t coordinate
pub fn t(&self) -> Scalar {
self.coords.t()
self.coords.t
}
}

View File

@ -63,13 +63,6 @@ impl<const D: usize> Vector<D> {
}
}
impl Vector<1> {
/// Access the curve vector's t coordinate
pub fn t(&self) -> Scalar {
self.0[0]
}
}
impl Vector<2> {
/// Extend a 2-dimensional vector into a 3-dimensional one
pub fn to_xyz(&self, z: Scalar) -> Vector<3> {