import type { Vec3 } from "../shared/types";

export function orbitPosition(angle: number, radius: number, yScale: number, zScale: number, centerX = 0): Vec3 {
  return [
    centerX + Math.cos(angle) * radius,
    Math.sin(angle * 1.37) * yScale,
    Math.sin(angle) * radius * zScale,
  ];
}

export function vecDistance(a: Vec3, b: Vec3) {
  const dx = a[0] - b[0];
  const dy = a[1] - b[1];
  const dz = a[2] - b[2];
  return Math.sqrt(dx * dx + dy * dy + dz * dz);
}
