Assume y vertical and x horizontal and z out of the page.
The moon is a disk. x^2 + y^2 <= R^2
For all the points, calculate z = sqrt(R^2 - y^2 - x^2)
Let the vector v(theta) = <sin(theta), 0, cos(theta)> point to the Sun.
Points <x,y,z> • v(theta) >= 0 should be bright, The rest dim.
* https://github.com/Sean-93/asciimoon/blob/main/src/component...
Assume y vertical and x horizontal and z out of the page.
The moon is a disk. x^2 + y^2 <= R^2
For all the points, calculate z = sqrt(R^2 - y^2 - x^2)
Let the vector v(theta) = <sin(theta), 0, cos(theta)> point to the Sun.
Points <x,y,z> • v(theta) >= 0 should be bright, The rest dim.