Create a gist now

Instantly share code, notes, and snippets.

anonymous /astroid.cpp
Created Nov 29, 2015

What would you like to do?
# include <Siv3D.hpp>
# define NUM 5000
void Main()
{
float radius,theta, x, y;
Window::Width() > Window::Height() ? radius = Window::Height() / 2 : radius = Window::Width() / 2;
while (System::Update())
{
for (theta = 0.0; theta < TwoPiF; theta += TwoPiF / NUM){
x = radius * Pow(Cos(theta), 3);
y = radius * Pow(Sin(theta), 3);
Point(x + Window::Width() / 2, y + Window::Height() / 2).draw();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment