latLngtoVector3 static method

Vector3 latLngtoVector3(
  1. ILatLng iLatLng
)

Implementation

static Vector3 latLngtoVector3(ILatLng iLatLng) {
  var latRad = iLatLng.latitude.radians;
  var lonRad = iLatLng.longitude.radians;

  var x = math.cos(lonRad) * math.cos(latRad);
  var y = math.sin(lonRad) * math.cos(latRad);
  var z = math.sin(latRad);

  return Vector3(x, y, z);
}