15 lines
413 B
Crystal
15 lines
413 B
Crystal
require "../../../src/engine/gravity/moving_body"
|
|
|
|
describe Gravity::MovingBody do
|
|
it "accelerate arbitrary points" do
|
|
earth = Gravity::MovingBody.new(
|
|
mass: 5972200000000000000000000.0,
|
|
position: Vector[0.0, 0.0],
|
|
acceleration: Vector[1.0, 0.0],
|
|
speed: Vector[2.0, 0.0],
|
|
)
|
|
earth.acceleration.should eq(Vector[1.0, 0.0])
|
|
earth.speed.should eq(Vector[2.0, 0.0])
|
|
end
|
|
end
|