module

PolygonContains::Cartesian

Instance methods

cross(a : Array(Float64), b : Array(Float64)) : Array(Float64)

Cross product of two 3D vectors

Returns a new vector [x, y, z]

Source
from(point : Point) : Array(Float64)

Convert spherical coordinates (lon, lat) tuple (radians) into Cartesian coordinates [x, y, z] on the unit sphere.

Example:

Cartesian.from({0.0, 0.0}) # => [1.0, 0.0, 0.0]
Source
normalize!(v : Array(Float64))

Normalize a 3D vector in place to unit length

Source