MCPcopy Create free account
hub / github.com/microsoft/SandDance / centroidLinePoint

Function centroidLinePoint

docs/app/js/sanddance-app.js:132325–132333  ·  view source on GitHub ↗
(lambda, phi)

Source from the content-addressed store, hash-verified

132323 centroidPointCartesian(x0, y0, z0);
132324}
132325function centroidLinePoint(lambda, phi) {
132326 lambda *= (0, _mathJs.radians), phi *= (0, _mathJs.radians);
132327 var cosPhi = (0, _mathJs.cos)(phi), x = cosPhi * (0, _mathJs.cos)(lambda), y = cosPhi * (0, _mathJs.sin)(lambda), z = (0, _mathJs.sin)(phi), w = (0, _mathJs.atan2)((0, _mathJs.sqrt)((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
132328 W1 += w;
132329 X1 += w * (x0 + (x0 = x));
132330 Y1 += w * (y0 + (y0 = y));
132331 Z1 += w * (z0 + (z0 = z));
132332 centroidPointCartesian(x0, y0, z0);
132333}
132334function centroidLineEnd() {
132335 centroidStream.point = centroidPoint;
132336}

Callers

nothing calls this directly

Calls 1

centroidPointCartesianFunction · 0.70

Tested by

no test coverage detected