kinematic

package
v0.0.0-...-219ab8e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Gravity float64 = -9.8
)

Variables

This section is empty.

Functions

func Displacement

func Displacement(initialVelocity float64, time float64, acceleration float64) float64

Displacement returns the displacement of an object given its initial velocity, time, and acceleration.

func FinalVelocity

func FinalVelocity(initialVelocity float64, time float64, acceleration float64) float64

FinalVelocity returns the final velocity of an object given its initial velocity, time, and acceleration.

func MoveTowards

func MoveTowards(speed float64, time float64, acceleration float64, target float64, position float64) float64

MoveTowards returns the displacement of an object moving towards a target given its speed, time, and acceleration. The displacement is clamped to the target position.

Types

type Vector

type Vector struct {
	X float64
	Y float64
}

func NewVector

func NewVector(x float64, y float64) Vector

func ZeroVector

func ZeroVector() Vector

func (Vector) DistanceFrom

func (v Vector) DistanceFrom(other Vector) float64

func (Vector) Equals

func (v Vector) Equals(other Vector) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL