<?php
function positionX($alpha, $r) {
$x = $r * cos(deg2rad($alpha)); // X coordinates
return $x;
}
function positionY($alpha, $r){
$y = $r * sin(deg2rad($alpha)); // Y coordinates
return $y;
}
echo round(positionX(0, 123)) . ', ' .round(positionY(0, 123)) . "\n";
echo round(positionX(45, 123)) . ', ' .round(positionY(45, 123)) . "\n";
echo round(positionX(90, 123)) . ', ' .round(positionY(90, 123)) . "\n";
echo round(positionX(135, 123)) . ', ' .round(positionY(135, 123)) . "\n";
echo round(positionX(180, 123)) . ', ' .round(positionY(180, 123)) . "\n";
echo round(positionX(22.5, 123)) . ', ' .round(positionY(22.5, 123)) . "\n";
preferences:
58.63 ms | 402 KiB | 5 Q