PitchKit
API Reference@pitchkit/coreFunctions

computeCometQuad()

function computeCometQuad(
   start, 
   end, 
   startWidth, 
   endWidth
): [Point, Point, Point, Point];

Defined in: packages/core/src/render/comet-geometry.ts:10

Computes the four corners of a tapered quadrilateral from start to end (both already in pixel space), narrow at start (startWidth) and wide at end (endWidth). SVG has no way to vary a <line>'s stroke-width along its length, so both renderers build this shape directly instead. Shared so the taper math can't drift between them.

Parameters

ParameterType
startPoint
endPoint
startWidthnumber
endWidthnumber

Returns

[Point, Point, Point, Point]

On this page