HalfSpaceTilted

class HalfSpaceTilted : public feasst::Shape

A half space divides space by a plane (or line in 2D). This is a generalized implementation of HalfSpace. This plane is specified either by two points, or a normal vector and distance from origin. See https://mathworld.wolfram.com/Point-PlaneDistance.html

Public Functions

HalfSpaceTilted(const Position &normal, const double distance_from_origin)
param normal:

A vector that is normal to the surface and points inside the half space.

param distance_from_origin:

The signed nearest distance of the surface to the origin. Negative if inside.

HalfSpaceTilted(const Position &point0, const Position &point1)

Alternatively, construct the planar surface with two points. The first is on the plane, and the second is inside the half space. The vector connecting these two points is perpendicular to the plane.

const Position &unit_normal() const

Return the unit normal vector.

const double distance_from_origin() const

Return the distance from the origin.

double nearest_distance(const Position &point) const

Return the distance from the point to the nearest point on the surface. The distance is negative if the point is inside of the shape and positive if it is outside.