MCPcopy Create free account
hub / github.com/idank/explainshell / d3_geo_circleAngle

Function d3_geo_circleAngle

explainshell/web/static/js/d3.v3.js:3062–3068  ·  view source on GitHub ↗
(cr, point)

Source from the content-addressed store, hash-verified

3060 };
3061 }
3062 function d3_geo_circleAngle(cr, point) {
3063 var a = d3_geo_cartesian(point);
3064 a[0] -= cr;
3065 d3_geo_cartesianNormalize(a);
3066 var angle = d3_acos(-a[1]);
3067 return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);
3068 }
3069 d3.geo.distance = function(a, b) {
3070 var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;
3071 return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);

Callers 1

d3_geo_circleInterpolateFunction · 0.85

Calls 3

d3_geo_cartesianFunction · 0.85
d3_acosFunction · 0.85

Tested by

no test coverage detected