JavaScript Blue Planet Part 3 (Planet Rotation using Trigonometry!)
Mt. Ford Studios
In this third and final part of the JavaScript Blue Planet series, we tidy up our code, fix up some bugs, and use lots of maths to create a rotating planet effect. We use Pythagoras' Theorem to work out our star velocities, and use parametric equations for our planet to figure out when something has crossed its circumference. Download the previous code below to get started and create your own magical blue planet floating in outer space!
CODE Previous tutorial (Blue Planet with Animated Star Field): https://drive.google.com/open?id=1h2J6OYi0RXyRrvRNrushCzFS267Hq0P4 This tutorial (Blue Planet with Rotation): https://drive.google.com/open?id=1jahOOWRVRD2bOSZtz9IQcBZP-XBgMJhL
MATHS LINKS Pythagoras' Theorem: https://www.mathsisfun.com/pythagoras.html Parametric Equation of a Circle: https://www.mathopenref.com/coordparamcircle.html
USEFUL LINKS w3schools JavaScript Math Reference: https://www.w3schools.com/jsref/jsref_obj_math.asp Visual Studio Code: https://code.visualstudio.com/
FIND US ON FACEBOOK https://www.facebook.com/MountfordStudios/ ... https://www.youtube.com/watch?v=sDS8ahpM-wA
69036191 Bytes