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

Function centroidRingPointFirst

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

Source from the content-addressed store, hash-verified

132344 centroidStream.point = centroidPoint;
132345}
132346function centroidRingPointFirst(lambda, phi) {
132347 lambda00 = lambda, phi00 = phi;
132348 lambda *= (0, _mathJs.radians), phi *= (0, _mathJs.radians);
132349 centroidStream.point = centroidRingPoint;
132350 var cosPhi = (0, _mathJs.cos)(phi);
132351 x0 = cosPhi * (0, _mathJs.cos)(lambda);
132352 y0 = cosPhi * (0, _mathJs.sin)(lambda);
132353 z0 = (0, _mathJs.sin)(phi);
132354 centroidPointCartesian(x0, y0, z0);
132355}
132356function centroidRingPoint(lambda, phi) {
132357 lambda *= (0, _mathJs.radians), phi *= (0, _mathJs.radians);
132358 var cosPhi = (0, _mathJs.cos)(phi), x = cosPhi * (0, _mathJs.cos)(lambda), y = cosPhi * (0, _mathJs.sin)(lambda), z = (0, _mathJs.sin)(phi), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = (0, _mathJs.hypot)(cx, cy, cz), w = (0, _mathJs.asin)(m), v = m && -w / m; // area weight multiplier

Callers

nothing calls this directly

Calls 1

centroidPointCartesianFunction · 0.70

Tested by

no test coverage detected