new Coo(longitude, latitude, prec)
Represents a Coo with configurable parsing options.
Parameters:
Name | Type | Description |
---|---|---|
longitude |
number | longitude (decimal degrees) |
latitude |
number | latitude (decimal degrees) |
prec |
number | precision (8: 1/1000th sec, 7: 1/100th sec, 6: 1/10th sec, 5: sec, 4: 1/10th min, 3: min, 2: 1/10th deg, 1: deg |
- Source:
Methods
dist2(pos)
Squared distance between 2 points (= 4.sin2(r/2))
Parameters:
Name | Type | Description |
---|---|---|
pos |
Coo | another position on the sphere |
- Source:
Returns:
||pos-this||2 = 4.sin2(r/2)
distance(pos)
Distance between 2 points on the sphere.
Parameters:
Name | Type | Description |
---|---|---|
pos |
Coo | another position on the sphere |
- Source:
Returns:
distance in degrees in range [0, 180]
equals(coo)
Test equality of Coo.
Parameters:
Name | Type | Description |
---|---|---|
coo |
Coo | Second coordinate to compare with |
- Source:
Returns:
True if the two coordinates are equal
format(options)
Format coordinates according to the options
Parameters:
Name | Type | Description |
---|---|---|
options |
string | 'd': decimal, 's': sexagésimal, '/': space separated, '2': return [ra,dec] in an array |
- Source:
Returns:
the formatted coordinates
parse(str)
parse a coordinate string. The coordinates can be in decimal or sexagesimal
Parameters:
Name | Type | Description |
---|---|---|
str |
string | string to parse |
- Source:
Returns:
true if the parsing succeded, false otherwise