Skip to main content

grid_north_direction

Function grid_north_direction 

Source
pub fn grid_north_direction(operation: &ProjectToMap) -> NorthReference
Expand description

Resolve grid north from an already-computed IfcMapConversion operation.

The map conversion rotation takes a project XY vector (x, y) to a map XY vector (ax - by, bx + ay) where (a, b) is the normalized (XAxisAbscissa, XAxisOrdinate) pair (ProjectToMap::x_axis_direction). Grid north is the map’s northing axis, (0, 1) in map coordinates, pulled back through the inverse of that rotation into the project frame: since the rotation matrix is orthonormal, its inverse is its transpose, giving (b, a).

A worked check: a = 1, b = 0 (no rotation) gives grid north (0, 1), i.e. grid north coincides with project north when the project’s local X axis is already aligned with the map’s easting axis. a = 0, b = 1 (project X rotated 90 degrees onto map northing) gives grid north (1, 0), i.e. the project’s own X axis now points toward map north – consistent with the project frame having been rotated a quarter turn relative to the map.

An IFC4X3 IfcMapConversionScaled scales the project axes by FactorX and FactorY before rotating, so the pull-back also divides by them: (b / FactorX, a / FactorY), normalized. With equal factors that is (b, a) again, and it is returned unchanged.