Skip to content

Commit

Permalink
Rename arguments to match Python implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Apr 26, 2024
1 parent 82a0b33 commit efa5d8a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/lat_lon2n_E.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export function lat_lon2n_E(
lat: number,
lon: number,
latitude: number,
longitude: number,
): [x: number, y: number, z: number] {
const sinLat = Math.sin(lat);
const cosLat = Math.cos(lat);
const sinLon = Math.sin(lon);
const cosLon = Math.cos(lon);
const sinLat = Math.sin(latitude);
const cosLat = Math.cos(latitude);
const sinLon = Math.sin(longitude);
const cosLon = Math.cos(longitude);

return [cosLat * cosLon, cosLat * sinLon, sinLat];
}
2 changes: 1 addition & 1 deletion src/n_E2lat_lon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function n_E2lat_lon(
x: number,
y: number,
z: number,
): [lat: number, lon: number] {
): [latitude: number, longitude: number] {
const sinLat = z;
const cosLat = Math.sqrt(y ** 2 + x ** 2);
const cosLatSinLon = y;
Expand Down
10 changes: 5 additions & 5 deletions test/nvector-test-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { WebSocket } from "ws";

export type NvectorTestClient = {
lat_lon2n_E: (
lat: number,
lon: number,
latitude: number,
longitude: number,
) => Promise<[x: number, y: number, z: number]>;

n_E2lat_lon: (
x: number,
y: number,
z: number,
) => Promise<[lat: number, lon: number]>;
) => Promise<[latitude: number, longitude: number]>;

close: () => void;
};
Expand All @@ -25,10 +25,10 @@ export async function createNvectorTestClient(): Promise<NvectorTestClient> {
});

return {
async lat_lon2n_E(lat, lon) {
async lat_lon2n_E(latitude, longitude) {
const [[x], [y], [z]] = await call<[[number], [number], [number]]>(
"lat_lon2n_E",
{ latitude: lat, longitude: lon },
{ latitude, longitude },
);

return [x, y, z];
Expand Down

0 comments on commit efa5d8a

Please sign in to comment.