Skip to main content

TensorMath.polarSort2d

Function

Sorts 2D points by polar angle relative to the center point.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

polarSort2d(inTensor, tensorShape, center): void

Sorts 2D points by polar angle relative to the center point.

inTensor - Float32Array with size (point count * 2). 2D points to sort

tensorShape - Should be {2, point count, 1}

center - Center point to use for polar angle sorting

Parameters

ParameterType
inTensorFloat32Array
tensorShapevec3
centervec2

Returns

void