[][src]Trait kalman_rs::traits::Plane

pub trait Plane {
    fn plane(&mut self) -> Vector3<f32>;
fn on_plane(&self, input_point: &Point3<f32>) -> Result<bool, &'static str>; }

Finding the attributes of a generic sensor's plane

Required methods

fn plane(&mut self) -> Vector3<f32>

Calculates the normal vector of the plane

fn on_plane(&self, input_point: &Point3<f32>) -> Result<bool, &'static str>

Checks that a given point is located on a plane

Loading content...

Implementors

impl Plane for Rectangle[src]

fn plane(&mut self) -> Vector<f32>[src]

Calculate the current normal vector of the plane of the surface. NOTE: plane() must be called before contains_from_local since contains_from_local requires the normal vector to be defined

Examples

use nalgebra as na;
use na::Point3;
 
let rectangular_points = [Point3::new(0.0, 0.0, 0.0), 
                          Point3::new(5.0,0.0,0.0), 
                          Point3::new(0.0,5.0,0.0), 
                          Point3::new(5.0,5.0,0.0)];
let tfm_matrix : na::Matrix4<f32>= na::Matrix4::new(1.0,5.0,7.0,2.0,  3.0,5.0,7.0,4.0,  8.0,4.0,1.0,9.0, 2.0,6.0,4.0,8.0);
let mut rectangle_sensor = Rectangle::new(rectangular_points, tfm_matrix).unwrap();
 
let normal_vector = rectangle_sensor.plane()

fn on_plane(&self, input_point: &Point3<f32>) -> Result<bool, &'static str>[src]

Check if a given point is located on the same plane as the sensor NOTE: plane() must be called becuase the normal vector is not currently known

Examples

use nalgebra as na;
use na::Point3;
 
let rectangular_points = [Point3::new(0.0, 0.0, 0.0), 
                          Point3::new(5.0,0.0,0.0), 
                          Point3::new(0.0,5.0,0.0), 
                          Point3::new(5.0,5.0,0.0)];
let tfm_matrix : na::Matrix4<f32>= na::Matrix4::new(1.0,5.0,7.0,2.0,  3.0,5.0,7.0,4.0,  8.0,4.0,1.0,9.0, 2.0,6.0,4.0,8.0);
let mut rectangle_sensor = Rectangle::new(rectangular_points, tfm_matrix).unwrap();
 
let on_plane = rectangle_sensor.on_plane(na::Point3::new(1.0, 3.0, 0.0)); //true

impl Plane for Trapezoid[src]

fn plane(&mut self) -> Vector<f32>[src]

Calculate the current normal vector of the plane of the surface. NOTE: plane() must be called before contains_from_local since contains_from_local requires the normal vector to be defined

Examples

use nalgebra as na;
use na::Point3;
 
let trapezoid_points = [Point3::new(0.0, 0.0, 0.0), 
                        Point3::new(5.0,1.0,0.0), 
                        Point3::new(5.0, 9.0,0.0), 
                        Point3::new(0.0,10.0,0.0)];
let tfm_matrix : na::Matrix4<f32>= na::Matrix4::new(1.0,5.0,7.0,2.0,  3.0,5.0,7.0,4.0,  8.0,4.0,1.0,9.0, 2.0,6.0,4.0,8.0);
let mut trap_sensor = Rectangle::new(trapezoid_points, tfm_matrix).unwrap();
 
let normal_vector = trap_sensor.plane();

fn on_plane(&self, input_point: &Point3<f32>) -> Result<bool, &'static str>[src]

Check if a given point is located on the same plane as the sensor NOTE: plane() must be called becuase the normal vector is not currently known

Examples

use nalgebra as na;
use na::Point3;
 
let trapezoid_points = [Point3::new(0.0, 0.0, 0.0), 
                        Point3::new(5.0,1.0,0.0), 
                        Point3::new(5.0, 9.0,0.0), 
                        Point3::new(0.0,10.0,0.0)];
let tfm_matrix : na::Matrix4<f32>= na::Matrix4::new(1.0,5.0,7.0,2.0,  3.0,5.0,7.0,4.0,  8.0,4.0,1.0,9.0, 2.0,6.0,4.0,8.0);
let mut trap_sensor = Rectangle::new(trapezoid_points, tfm_matrix).unwrap();
 
let on_sensor_plane = trap_sensor.on_plane(Point3::new(1.0, 1.0, 0)); //true
Loading content...