PointFromLatLng returns a Point for the given LatLng. The maximum error in the result is 1.5 * machineEpsilon64. (This does not include the error of converting degrees, E5, E6, or E7 into radians.)
(ll LatLng)
| 83 | // The maximum error in the result is 1.5 * machineEpsilon64. (This does not |
| 84 | // include the error of converting degrees, E5, E6, or E7 into radians.) |
| 85 | func PointFromLatLng(ll LatLng) Point { |
| 86 | phi := ll.Lat.Radians() |
| 87 | theta := ll.Lng.Radians() |
| 88 | cosphi := math.Cos(phi) |
| 89 | return Point{r3.Vector{X: math.Cos(theta) * cosphi, Y: math.Sin(theta) * cosphi, Z: math.Sin(phi)}} |
| 90 | } |
| 91 | |
| 92 | // LatLngFromPoint returns an LatLng for a given Point. |
| 93 | func LatLngFromPoint(p Point) LatLng { |
searching dependent graphs…