createDirectionalScale MethodStatic

Create a matrix that scales along a specified direction. This means if you multiply the returned matrix by a vector, you get directional scale of that vector. Suppose plane is the plane perpendicular to the direction. When scale = 0, directional scale is projection of the vector to the plane. When scale = 1, directional scale is the vector itself. When scale = -1, directional scale is mirror of the vector across the plane. In general, When scale != 0, the result is computed by first projecting the vector to the plane, then translating that projection along the direction (if scale > 0) or in opposite direction (if scale < 0).

The matrix is I+(s1)DDTwith D being the normalized direction vector and s being the scale.\text{The matrix is } I + (s-1) D D^T
\\ \text{with }D\text{ being the normalized direction vector and }s\text{ being the scale.}
  • Visualization can be found at itwinjs.org/sandbox/SaeedTorabi/DirectionalScale

createDirectionalScale(direction: Vector3d, scale: number, result?: Matrix3d): Matrix3d

Parameter Type Description
direction Vector3d  
scale number  
result Matrix3d  

Returns - Matrix3d

Defined in

Last Updated: 28 October, 2024