Documentation
¶
Overview ¶
Circle: Chapter 20, Smallest Circle containing three Celestial Bodies.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Smallest ¶
Smallest finds the smallest circle containing three points.
Arguments should represent coordinates in right ascension and declination or longitude and latitude. Result Δ is the diameter of the circle, typeI is true if solution is of type I.
type I Two points on circle, one interior. type II All three points on circle.
根据三点坐标,求最小圆直径
Example (A) ¶
// Example 20.a, p. 128.
r1 := unit.NewRA(12, 41, 8.64).Angle()
r2 := unit.NewRA(12, 52, 5.21).Angle()
r3 := unit.NewRA(12, 39, 28.11).Angle()
d1 := unit.NewAngle('-', 5, 37, 54.2)
d2 := unit.NewAngle('-', 4, 22, 26.2)
d3 := unit.NewAngle('-', 1, 50, 3.7)
d, t := circle.Smallest(r1, d1, r2, d2, r3, d3)
fd := sexa.FmtAngle(d)
fmt.Printf("Δ = %.5j = %m\n", fd, fd)
if t {
fmt.Println("type I")
} else {
fmt.Println("type II")
}
Output: Δ = 4°.26363 = 4°16′ type II
Example (B) ¶
// Exercise, p. 128.
r1 := unit.NewRA(9, 5, 41.44).Angle()
r2 := unit.NewRA(9, 9, 29).Angle()
r3 := unit.NewRA(8, 59, 47.14).Angle()
d1 := unit.NewAngle(' ', 18, 30, 30)
d2 := unit.NewAngle(' ', 17, 43, 56.7)
d3 := unit.NewAngle(' ', 17, 49, 36.8)
d, t := circle.Smallest(r1, d1, r2, d2, r3, d3)
fmt.Printf("Δ = %m\n", sexa.FmtAngle(d))
if t {
fmt.Println("type I")
} else {
fmt.Println("type II")
}
Output: Δ = 2°19′ type I
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.