pub fn point_distance_squared(self, point: Vec3f) -> f32 {
        let ab = self.end - self.start;
        let ac = point - self.start;
        let bc = point - self.end;
        let e = ac.dot(ab);
        // Handle cases where c projects outside ab
        if e <= 0.0 {
            ac.dot(ac)
        }
        else {
            let f = ab.dot(ab);
            if e >= f {
                bc.dot(bc)
            }
            else {
                // Handle cases where c projects onto ab
                ac.dot(ac) - e * e / f
            }
        }
    }
/// Return the squared distance from this segment to the input
/// `point`.
///
/// Adapted from "Real-Time Collision Detection" by Christer
/// Ericson, published by Morgan Kaufmann Publishers, Copyright
/// 2005 Elsevier Inc
Return the squared distance from this segment to the input
`point`.

Adapted from "Real-Time Collision Detection" by Christer
Ericson, published by Morgan Kaufmann Publishers, Copyright
2005 Elsevier Inc
Return the squared distance from this segment to the input ` point ` . Adapted from " Real - Time Collision Detection " by Christer Ericson published by Morgan Kaufmann Publishers Copyright 2005 Elsevier Inc
pub fn point_distance_squared(self, point: Vec3f) -> f32 {
        let ab = self.end - self.start;
        let ac = point - self.start;
        let bc = point - self.end;
        let e = ac.dot(ab);
        // Handle cases where c projects outside ab
        if e <= 0.0 {
            ac.dot(ac)
        }
        else {
            let f = ab.dot(ab);
            if e >= f {
                bc.dot(bc)
            }
            else {
                // Handle cases where c projects onto ab
                ac.dot(ac) - e * e / f
            }
        }
    }
pub fn point_distance_squared ( self , point : Vec3f ) -> f32 { let ab = self . end - self . start ; let ac = point - self . start ; let bc = point - self . end ; let e = ac . dot ( ab ) ; // Handle cases where c projects outside ab if e <= 0.0 { ac . dot ( ac ) } else { let f = ab . dot ( ab ) ; if e >= f { bc . dot ( bc ) } else { // Handle cases where c projects onto ab ac . dot ( ac ) - e * e / f } } }
Return the squared distance from this segment to the input
`point`.
Return the squared distance from this segment to the input ` point ` .
self
point
Vec3f
self
point
Vec3f