astroimsim-geometry 0.1.17

Geometry package for astroimsim
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use plotpy::Plot;
use crate::coordinate_system::Coordinates::RELATIVE;
use crate::coordinate_system::CoordinateSystem;
use crate::grid2d::{PlotPoint, GRID2D};
use crate::points::Point;

pub fn test_project(){
    let mut plot = Plot::new();
    let coords = CoordinateSystem::new((1.0,0.0),(0.0,1.0),(0.0,0.0), "test");
    let grid = GRID2D::new_empty((3,3),(1.0,1.0), (0.0,0.0), 0.01,RELATIVE(coords.clone()));

    let point = Point::new(-0.8,0.7, RELATIVE(coords));
    point.plot(&mut plot, "orange");
    let projected_point = grid.project(&point);
    grid.plot_points(&mut plot, PlotPoint::Given(projected_point));
    plot.show("test").unwrap();

}