Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
スーパー楕円の座標を計算する
use Math::Trig;
my $m = 1.6;
my $b = 2.8;
for (my $theta = 90; $theta >= 0; $theta -= 5 ){
my $x = cos($theta / 180 * pi);
$y = $m * (1 - $x ** $b) ** (1/$b);
printf "x=%f, %f, %f\n", $x, $x * 300, $y * 300;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment