coord_tf

namespace nin {
    template <coordsys_traits C1, coordsys_traits CF, typename Bt = std::tuple<>>
    class coord_tf;
}

A coord_tf is a transformation function between two coordinate systems. It captures the composed transformation at the moment of creation and applies it without further tree traversal or backend calls.

coord_tf objects are created by mapCS(), not constructed directly. The template parameters C1 (source traits), CF (target traits), and Bt (bridge tuple) are all deduced automatically.

Member functions

operator ()

applies the transformation

CF::quantity_type operator()(C1::quantity_type qty) const

(1)

coord_value<CF> operator()(coord_value<C1> val) const

(2)

coord_cloud<CF, N> operator()(coord_cloud<C1, N> cl) const

(3)

coord_value<CF> operator()() const

(4)

  • (1) Transforms a raw quantity.

  • (2) Transforms a coord_value, returning a new value in the target coordinate system.

  • (3) Transforms a coord_cloud, applying the same transformation to every element.

  • (4) Returns the origin of from_CS() expressed in to_CS().

from_CS
to_CS

access the endpoint coordinate systems

coordsys<C1> const& from_CS() const

(1)

coordsys<CF> const& to_CS() const

(2)

Returns the source (1) or destination (2) coordinate system. These are linked copies of the coordinate systems passed to mapCS().

Non-member functions

inv

inverse transformation

auto inv(coord_tf tf)

(1)

Returns a coord_tf that transforms in the opposite direction: from to_CS() back to from_CS(). If the original transformation crosses bridges, the bridge chain is reversed.

compose

compose two transformations

auto compose(coord_tf after, coord_tf first)

(1)

Returns a single coord_tf equivalent to applying first then after. The target of first must be the same coordinate system as the source of after.