Skip to main content
Version: Next

getRotatedBoxPoints

Callable

  • getRotatedBoxPoints(center: Point2D, halfWidth: number, halfHeight: number, rotation: number): Point2D[]

  • Returns eight sampled points around a rotated box.

    The returned points include the four corners and four edge midpoints, rotated about the supplied center.


    Parameters

    • center: Point2D

      Box center point.

    • halfWidth: number

      Half of the unrotated box width.

    • halfHeight: number

      Half of the unrotated box height.

    • rotation: number

      Rotation angle in radians.

    Returns Point2D[]

    Rotated corner and edge-midpoint coordinates.