pub struct PlanRectangle { /* private fields */ }Expand description
The rectangle of least area enclosing an object’s footprint, oriented in plan: a centre, two unit axes and the half extents along them.
Every value is bounded: the true centre lies within
Self::centre_radius_metres of Self::centre, each true axis within
Self::axis_error_radians of the stated one, and each true half
extent inside its interval. The evidence is exact exactly when every
bound is a point and the orientation is RectangleOrientation::Unique.
Implementations§
Source§impl PlanRectangle
impl PlanRectangle
Sourcepub fn try_new(
object: ObjectId,
centre: [f64; 2],
centre_radius: f64,
axes: [[f64; 2]; 2],
axis_error: f64,
half_extents: [(f64, f64); 2],
orientation: RectangleOrientation,
evidence: Evidence,
) -> Result<Self, PlanSpanError>
pub fn try_new( object: ObjectId, centre: [f64; 2], centre_radius: f64, axes: [[f64; 2]; 2], axis_error: f64, half_extents: [(f64, f64); 2], orientation: RectangleOrientation, evidence: Evidence, ) -> Result<Self, PlanSpanError>
The rectangle enclosing object’s footprint.
axes are unit vectors, the second the first turned a quarter
counter-clockwise, the first pointing into [0, 90) degrees, so one
rectangle has one spelling. half_extents are (lower, upper)
intervals along the axes in order.
Sourcepub fn centre_radius_metres(&self) -> f64
pub fn centre_radius_metres(&self) -> f64
How far, in metres, the true centre can lie from Self::centre.
Sourcepub fn axes(&self) -> [[f64; 2]; 2]
pub fn axes(&self) -> [[f64; 2]; 2]
The two unit axes, the second the first turned a quarter counter-clockwise.
Sourcepub fn axis_error_radians(&self) -> f64
pub fn axis_error_radians(&self) -> f64
How far, in radians, each true axis can be turned from the stated one.
Sourcepub fn half_extents_metres(&self) -> [(f64, f64); 2]
pub fn half_extents_metres(&self) -> [(f64, f64); 2]
The half extents along the two axes, each (lower, upper) metres.
Sourcepub fn orientation(&self) -> RectangleOrientation
pub fn orientation(&self) -> RectangleOrientation
How well the orientation is known.
Sourcepub fn width_and_length(&self) -> Result<[(f64, f64); 2], String>
pub fn width_and_length(&self) -> Result<[(f64, f64); 2], String>
The footprint’s width and length along its own axes: the shorter and
the longer side, each (lower, upper) metres.
Refused unless the orientation is RectangleOrientation::Unique:
another rectangle of least area may have other sides. Near-equal
sides are fine; which of them is the longer does not matter here.