Module pix_engine::shape::point

source ·
Expand description

A N-dimensional shape type representing geometric points used for drawing.

Examples

You can create a Point using Point::new:

use pix_engine::prelude::*;

let p = Point::new([10, 20]);

…or by using the point! macro:

use pix_engine::prelude::*;

let p: Point<i32> = point!(); // origin point at (0, 0, 0)

let p = point!(5); // 1D point on the x-axis

let p = point!(5, 10); // 2D point in the x/y-plane

let p = point!(5, 10, 7); // 3D point

Structs

  • A Point in N-dimensional space.