Skip to content

Instantly share code, notes, and snippets.

View Ved-Mahajan's full-sized avatar
👋

Ved Mahajan Ved-Mahajan

👋
  • Technische Universität Darmstadt
  • Darmstadt
  • 21:58 (UTC +02:00)
View GitHub Profile
using Animations
using Javis
using Luxor
function ground(args...)
sethue("black")
background("white")
end
function boxes(p::Point,w,h,action,color)
@Ved-Mahajan
Ved-Mahajan / two_body.jl
Created June 27, 2021 10:03
A code to make an animation of solution of two body problem using `Javis.jl`
using Animations
using Javis
using NBodySimulator
using StaticArrays
# Define the bodies
body1 = MassBody(SVector(0.0, 1.0, 0.0), SVector( 5.775e-6, 0.0, 0.0), 2.0)
body2 = MassBody(SVector(0.0,-1.0, 0.0), SVector(-5.775e-6, 0.0, 0.0), 2.0)
G = 6.673e-11