Skip to content

Intermact API Reference / @intermact/core / CoordinateTransform2D

Class: CoordinateTransform2D ​

Defined in: packages/core/src/layout/coordinate-transform.ts:8

Scene coordinate transforms (design.md §7.2). Maps between absolute world coordinates, normalized domain UV, and polar coordinates for a 2D scene.

Constructors ​

Constructor ​

new CoordinateTransform2D(props): CoordinateTransform2D

Defined in: packages/core/src/layout/coordinate-transform.ts:9

Parameters ​

props ​

Scene2DProps

Returns ​

CoordinateTransform2D

Methods ​

absToRel() ​

absToRel(value): RelUV

Defined in: packages/core/src/layout/coordinate-transform.ts:12

Map absolute world coordinates to normalized domain UV in [0,1]².

Parameters ​

value ​

AbsXY

Returns ​

RelUV


fromPolar() ​

fromPolar(r, theta): AbsXY

Defined in: packages/core/src/layout/coordinate-transform.ts:31

Absolute point from polar coordinates.

Parameters ​

r ​

number

theta ​

number

Returns ​

AbsXY


relToAbs() ​

relToAbs(value): AbsXY

Defined in: packages/core/src/layout/coordinate-transform.ts:20

Map normalized domain UV back to absolute world coordinates.

Parameters ​

value ​

RelUV

Returns ​

AbsXY


toPolar() ​

toPolar(value): object

Defined in: packages/core/src/layout/coordinate-transform.ts:26

Polar radius and angle (radians) of an absolute point.

Parameters ​

value ​

AbsXY

Returns ​

object

r ​

readonly r: number

theta ​

readonly theta: number

Intermact v1.0 — 文档覆盖 Phase-1 / Phase-2 / Phase-3(全阶段)