Skip to content

Commit

Permalink
Merge pull request #120 from observerly/feature/projection/ConvertEqu…
Browse files Browse the repository at this point in the history
…atorialToInterruptedCollignonCartesian

feat: add ConvertEquatorialToInterruptedCollignonCartesian to projection module in @observerly/skysolve
  • Loading branch information
michealroberts authored Dec 5, 2024
2 parents 180c989 + b3a90eb commit 2278484
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/projection/projection.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,18 @@ func ConvertEquatorialToLambertCylindricalCartesian(eq astrometry.ICRSEquatorial
}

/*****************************************************************************************************************/

func ConvertEquatorialToInterruptedCollignonCartesian(eq astrometry.ICRSEquatorialCoordinate, z float64) (x, y float64) {
sigma := math.Sqrt(3 * (1 - math.Abs(z)))

// Calculate the y coordinate:
y = (math.Pi / 4) * (2 - sigma)

facetX := (math.Pi / 4) * (2 * math.Floor(2+(2*Radians(eq.RA)/math.Pi)-3))
// Calculate the x coordinate:
x = facetX + sigma*(Radians(eq.Dec)-facetX)
// Return the x and y coordinates in degrees:
return Degrees(x), Degrees(math.Copysign(y, eq.Dec))
}

/*****************************************************************************************************************/

0 comments on commit 2278484

Please sign in to comment.