spatial-math 0.4.0-beta.1

Spatial math library for articulated body simulation
Documentation
// Copyright (C) 2020-2025 spatial-math authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![doc = include_str!("../README.md")]
#![deny(warnings)]
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::must_use_candidate)]

pub extern crate nalgebra as na;

// Internal modules
mod alias;
mod matrix;
mod spatial_inertia;
mod spatial_vec;
mod traits;
mod transform;

// Public modules
pub mod exts;

// Re-export core types and traits
pub use alias::*;
pub use matrix::SymmetricMat3;
pub use spatial_inertia::{ArticulatedBodyInertia, RigidBodyInertia};
pub use spatial_vec::{SpatialForceVector, SpatialMotionVector, SpatialVector};
pub use traits::SpatialVec;
pub use transform::{PluckerTransform, PlukerRotation, Pose};

#[cfg(feature = "f64")]
mod real {
    pub type Real = f64;
    pub const PI: Real = std::f64::consts::PI;
    pub const FRAC_PI_2: Real = std::f64::consts::FRAC_PI_2;
}

#[cfg(not(feature = "f64"))]
mod real {
    pub type Real = f32;
    pub const PI: Real = std::f32::consts::PI;
    pub const FRAC_PI_2: Real = std::f32::consts::FRAC_PI_2;
}

pub use real::*;