File size: 222 Bytes
a60cb50
 
 
 
 
 
1
2
3
4
5
6
function sphericalToCartesian(yaw: number, pitch: number, width: number, height: number): { x: number, y: number } {
  const x = ((yaw + 180) / 360) * width;
  const y = ((pitch + 90) / 180) * height;

  return { x, y };
}