Vulcan
Aerospace Engineering Utilities Built on Janus
Loading...
Searching...
No Matches
vulcan::geometry Namespace Reference

Functions

template<typename Scalar>
Scalar slant_range (const Vec3< Scalar > &r_observer, const Vec3< Scalar > &r_target)
 Compute slant range (distance) between two points.
template<typename Scalar>
Vec2< Scalar > los_angles (const Vec3< Scalar > &r_observer, const Vec3< Scalar > &r_target)
 Compute line-of-sight azimuth and elevation angles.
template<typename Scalar>
Vec2< Scalar > los_rate (const Vec3< Scalar > &r_obs, const Vec3< Scalar > &v_obs, const Vec3< Scalar > &r_tgt, const Vec3< Scalar > &v_tgt)
 Compute line-of-sight angular rates.
template<typename Scalar>
Scalar ray_sphere_intersection (const Vec3< Scalar > &origin, const Vec3< Scalar > &direction, const Vec3< Scalar > &center, const Scalar &radius)
 Ray-sphere intersection.
template<typename Scalar>
Scalar ray_plane_intersection (const Vec3< Scalar > &origin, const Vec3< Scalar > &direction, const Vec3< Scalar > &plane_normal, const Vec3< Scalar > &plane_point)
 Ray-plane intersection.
template<typename Scalar>
Scalar point_in_cone (const Vec3< Scalar > &point, const Vec3< Scalar > &apex, const Vec3< Scalar > &axis, const Scalar &half_angle)
 Check if a point lies within a cone (e.g., sensor FOV).
template<typename Scalar>
Vec3< Scalar > project_to_plane (const Vec3< Scalar > &point, const Vec3< Scalar > &plane_normal, const Vec3< Scalar > &plane_point)
 Project a point onto a plane.
template<typename Scalar>
LLA< Scalar > ground_track_point (const Vec3< Scalar > &r_ecef, const EarthModel &model=EarthModel::WGS84())
 Project ECEF position to ellipsoid surface (ground track point).
template<typename Scalar>
Vec3< Scalar > ground_track_ecef (const Vec3< Scalar > &r_ecef, const EarthModel &model=EarthModel::WGS84())
 Compute ground track point and return as ECEF.

Function Documentation

◆ ground_track_ecef()

template<typename Scalar>
Vec3< Scalar > vulcan::geometry::ground_track_ecef ( const Vec3< Scalar > & r_ecef,
const EarthModel & model = EarthModel::WGS84() )

Compute ground track point and return as ECEF.

Projects the position to the ellipsoid surface and returns the ECEF coordinates of that point.

Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
r_ecefPosition in ECEF [m]
modelEarth model (default: WGS84)
Returns
ECEF position of ground track point [m]

◆ ground_track_point()

template<typename Scalar>
LLA< Scalar > vulcan::geometry::ground_track_point ( const Vec3< Scalar > & r_ecef,
const EarthModel & model = EarthModel::WGS84() )

Project ECEF position to ellipsoid surface (ground track point).

Computes the point on the Earth's surface directly below (or above) the given ECEF position. Returns LLA with altitude set to zero.

Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
r_ecefPosition in ECEF [m]
modelEarth model (default: WGS84)
Returns
LLA coordinates of ground track point (altitude = 0)

◆ los_angles()

template<typename Scalar>
Vec2< Scalar > vulcan::geometry::los_angles ( const Vec3< Scalar > & r_observer,
const Vec3< Scalar > & r_target )

Compute line-of-sight azimuth and elevation angles.

Computes the look angles from observer to target in the observer's local coordinate frame (typically NED or ENU).

Convention:

  • Azimuth: angle from +X axis, positive clockwise when viewed from above
  • Elevation: angle from XY plane, positive upward
Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
r_observerObserver position [m]
r_targetTarget position [m]
Returns
[azimuth, elevation] in radians

◆ los_rate()

template<typename Scalar>
Vec2< Scalar > vulcan::geometry::los_rate ( const Vec3< Scalar > & r_obs,
const Vec3< Scalar > & v_obs,
const Vec3< Scalar > & r_tgt,
const Vec3< Scalar > & v_tgt )

Compute line-of-sight angular rates.

Computes the time derivative of LOS angles given relative positions and velocities of observer and target.

Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
r_obsObserver position [m]
v_obsObserver velocity [m/s]
r_tgtTarget position [m]
v_tgtTarget velocity [m/s]
Returns
[azimuth_rate, elevation_rate] in rad/s

◆ point_in_cone()

template<typename Scalar>
Scalar vulcan::geometry::point_in_cone ( const Vec3< Scalar > & point,
const Vec3< Scalar > & apex,
const Vec3< Scalar > & axis,
const Scalar & half_angle )

Check if a point lies within a cone (e.g., sensor FOV).

Determines if a point is inside a cone defined by its apex, axis direction, and half-angle. Useful for sensor field-of-view checks.

Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
pointPoint to test
apexCone apex (e.g., sensor location)
axisCone axis direction (should be normalized)
half_angleCone half-angle in radians
Returns
1.0 if point is inside cone, 0.0 otherwise (Scalar for symbolic compat)

◆ project_to_plane()

template<typename Scalar>
Vec3< Scalar > vulcan::geometry::project_to_plane ( const Vec3< Scalar > & point,
const Vec3< Scalar > & plane_normal,
const Vec3< Scalar > & plane_point )

Project a point onto a plane.

Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
pointPoint to project
plane_normalPlane normal (should be normalized)
plane_pointA point on the plane
Returns
Projected point on the plane

◆ ray_plane_intersection()

template<typename Scalar>
Scalar vulcan::geometry::ray_plane_intersection ( const Vec3< Scalar > & origin,
const Vec3< Scalar > & direction,
const Vec3< Scalar > & plane_normal,
const Vec3< Scalar > & plane_point )

Ray-plane intersection.

Computes the distance along a ray to intersection with an infinite plane.

Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
originRay origin point
directionRay direction (should be normalized)
plane_normalPlane normal vector (should be normalized)
plane_pointA point on the plane
Returns
Distance to intersection, or negative if parallel or behind

◆ ray_sphere_intersection()

template<typename Scalar>
Scalar vulcan::geometry::ray_sphere_intersection ( const Vec3< Scalar > & origin,
const Vec3< Scalar > & direction,
const Vec3< Scalar > & center,
const Scalar & radius )

Ray-sphere intersection.

Computes the distance along a ray to the nearest intersection with a sphere. Uses the geometric solution for numerical stability.

Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
originRay origin point
directionRay direction (should be normalized)
centerSphere center
radiusSphere radius
Returns
Distance to nearest intersection, or negative if no intersection

◆ slant_range()

template<typename Scalar>
Scalar vulcan::geometry::slant_range ( const Vec3< Scalar > & r_observer,
const Vec3< Scalar > & r_target )

Compute slant range (distance) between two points.

Template Parameters
ScalarScalar type (double or casadi::MX)
Parameters
r_observerObserver position [m]
r_targetTarget position [m]
Returns
Distance between points [m]