nalgebra::geometry

Type Alias Point2

Source
pub type Point2<T> = Point<T, 2>;
Expand description

A statically sized 2-dimensional column point.

Because this is an alias, not all its methods are listed here. See the Point type too.

Aliased Type§

struct Point2<T> {
    pub coords: Matrix<T, Const<2>, Const<1>, <DefaultAllocator as Allocator<Const<2>>>::Buffer<T>>,
}

Fields§

§coords: Matrix<T, Const<2>, Const<1>, <DefaultAllocator as Allocator<Const<2>>>::Buffer<T>>

The coordinates of this point, i.e., the shift from the origin.

Implementations§

Source§

impl<T: Scalar> Point2<T>

Source

pub const fn new(x: T, y: T) -> Self

Initializes this point from its components.

§Example
let p = Point2::new(1.0, 2.0);
assert!(p.x == 1.0 && p.y == 2.0);

Trait Implementations§

Source§

impl From<BVec2> for Point2<bool>

Source§

fn from(e: BVec2) -> Point2<bool>

Converts to this type from the input type.
Source§

impl From<DVec2> for Point2<f64>

Source§

fn from(e: DVec2) -> Point2<f64>

Converts to this type from the input type.
Source§

impl From<IVec2> for Point2<i32>

Source§

fn from(e: IVec2) -> Point2<i32>

Converts to this type from the input type.
Source§

impl From<UVec2> for Point2<u32>

Source§

fn from(e: UVec2) -> Point2<u32>

Converts to this type from the input type.
Source§

impl From<Vec2> for Point2<f32>

Source§

fn from(e: Vec2) -> Point2<f32>

Converts to this type from the input type.