Projectile motion in Grasshopper with C#

💣 I started this year by cleaning out old files and stumbled upon this Grasshopper script from my architecture school days. It simulates shooting cannon balls in Rhino. Looking back, I must have really disliked my architecture projects to the extent that I created a script to virtually bombard them!

📐 What’s fascinating is seeing simple high school physics come to life in this way. The script is less than 100 lines of code and is essentially a simulation of projectile motion following these two equations:

➡️ Horizontal motion: Constant, as there’s no horizontal acceleration. Equation: x = v0 × cos(α) × t

⬆️ Vertical Motion: Accelerates downwards due to gravity, giving the projectile a parabolic path. Equation: z = v0 × sin(α) × t – 1/2 × g × t^2

Here, v0 represents the initial velocity, α is the launch angle, t is the time, and g is the acceleration due to gravity (9.82 m/s^2).

🚀 Happy to share the script in case anyone is interested to play with it. Fire off a comment or shoot me an email! (pun intended)

#rhino3d #grasshopper3d #physics #simulation #computationaldesign

Leave a comment