Created
November 26, 2013 01:06
-
-
Save kaz-utashiro/7651789 to your computer and use it in GitHub Desktop.
スーパー楕円の座標を計算する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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