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

Function rotation

explainshell/web/static/js/d3.v3.js:3003–3006  ·  view source on GitHub ↗
(λ, φ)

Source from the content-addressed store, hash-verified

3001 function d3_geo_rotationφγ(δφ, δγ) {
3002 var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);
3003 function rotation(λ, φ) {
3004 var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;
3005 return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), Math.asin(Math.max(-1, Math.min(1, k * cosδγ + y * sinδγ))) ];
3006 }
3007 rotation.invert = function(λ, φ) {
3008 var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;
3009 return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), Math.asin(Math.max(-1, Math.min(1, k * cosδφ - x * sinδφ))) ];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected