Skip to content

editor / positionKeepingPoint

Function: positionKeepingPoint() ​

positionKeepingPoint(box, local, drawn): Point

Defined in: model/position-keeping-point.ts:26

Position of a turned box such that one of its points is drawn at a given point of the SVG: b = P − (k + R(l − k)), k the half size of the box, l the point relative to the top-left of the box before it turns, R the turn about the center (DERIV-turned-shape step 5). The shape is rigid under the turn: every other point keeps its place relative to that one.

Parameters ​

box ​

TurnedSize

angle, width and height of the box

local ​

Point

the point, relative to the top-left of the box before it turns

drawn ​

Point

where it must be drawn, in the SVG

Returns ​

Point

the top-left of the box before it turns

Kind ​

domain

See ​

DERIV-turned-shape