Skip to content

Commit

Permalink
fix: 🏷️ fix incorrect units
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed May 16, 2023
1 parent a372498 commit d790d63
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ootk",
"version": "2.0.0",
"version": "2.0.1",
"description": "Orbital Object Toolkit including SGP4 Propagator and Coordinate Transforms",
"main": "dist/ootk.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/objects/sensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ export class Sensor extends BaseObject {
const rae = this.getRae(sat, curTime);

// Radians to Degrees
rae.az = <Degrees>((rae.az * 360) / TAU);
rae.el = <Degrees>((rae.el * 360) / TAU);
const azDeg = <Degrees>((rae.az * 360) / TAU);
const elDeg = <Degrees>((rae.el * 360) / TAU);

const isInView = this.isRaeInFov(rae);

Expand All @@ -250,8 +250,8 @@ export class Sensor extends BaseObject {
const pass = <Lookangles>{
type,
time: curTime,
az: rae.az,
el: rae.el,
az: azDeg,
el: elDeg,
rng: rae.rng,
};

Expand Down
2 changes: 1 addition & 1 deletion src/objects/star.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class Star extends SpaceObject {
this.dec,
);

return { az: <Degrees>(starPos.az * RAD2DEG), el: <Degrees>(starPos.el * RAD2DEG), rng: <Kilometers>250000 };
return { az: starPos.az, el: starPos.el, rng: <Kilometers>250000 };
}

private static calculateTimeVariables(date: Date): { gmst: GreenwichMeanSiderealTime; j: number } {
Expand Down
4 changes: 2 additions & 2 deletions src/transforms/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ class Transforms {
*/
public static sez2rae(sez: SezVec3): RaeVec3 {
const rng = <Kilometers>Math.sqrt(sez.s * sez.s + sez.e * sez.e + sez.z * sez.z);
const el = <Degrees>Math.asin(sez.z / rng);
const az = <Degrees>(Math.atan2(-sez.e, sez.s) + PI);
const el = <Radians>Math.asin(sez.z / rng);
const az = <Radians>(Math.atan2(-sez.e, sez.s) + PI);

return <RaeVec3>{
rng,
Expand Down
4 changes: 2 additions & 2 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export type LlaVec3 = {
};
export type RaeVec3 = {
rng: Kilometers;
az: Degrees;
el: Degrees;
az: Radians;
el: Radians;
};
export type SezVec3 = {
s: Kilometers;
Expand Down

0 comments on commit d790d63

Please sign in to comment.