MCPcopy Index your code
hub / github.com/processing/p5.js / polylineLength

Function polylineLength

src/shape/custom_shapes.js:13–19  ·  view source on GitHub ↗
(vertices)

Source from the content-addressed store, hash-verified

11
12// ---- UTILITY FUNCTIONS ----
13function polylineLength(vertices) {
14 let length = 0;
15 for (let i = 1; i < vertices.length; i++) {
16 length += vertices[i-1].position.dist(vertices[i].position);
17 }
18 return length;
19}
20
21// ---- GENERAL BUILDING BLOCKS ----
22

Callers 2

hullLengthMethod · 0.85
visitSplineSegmentMethod · 0.85

Calls 1

distMethod · 0.80

Tested by

no test coverage detected