Skip to content

Instantly share code, notes, and snippets.

@kaz-utashiro
Created November 26, 2013 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaz-utashiro/7651789 to your computer and use it in GitHub Desktop.
Save kaz-utashiro/7651789 to your computer and use it in GitHub Desktop.
スーパー楕円の座標を計算する
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