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

Function centroidLinePointFirst

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

Source from the content-addressed store, hash-verified

132314 centroidStream.point = centroidLinePointFirst;
132315}
132316function centroidLinePointFirst(lambda, phi) {
132317 lambda *= (0, _mathJs.radians), phi *= (0, _mathJs.radians);
132318 var cosPhi = (0, _mathJs.cos)(phi);
132319 x0 = cosPhi * (0, _mathJs.cos)(lambda);
132320 y0 = cosPhi * (0, _mathJs.sin)(lambda);
132321 z0 = (0, _mathJs.sin)(phi);
132322 centroidStream.point = centroidLinePoint;
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);

Callers

nothing calls this directly

Calls 1

centroidPointCartesianFunction · 0.70

Tested by

no test coverage detected