Physics

package
v0.0.0-...-b5f20da Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Force

type Force struct {
	Count  int
	Update func(f *Force)
	// contains filtered or unexported fields
}

func GetNewForce

func GetNewForce(updater ForceUpdater, v *Vector) *Force

func GetNewPlainForce

func GetNewPlainForce() *Force

func GetNewPlainForceAlwaysActive

func GetNewPlainForceAlwaysActive() *Force

func GetNewPlainForceDir

func GetNewPlainForceDir(x, y, z float64) *Force

func GetNewPlainForceOfDuration

func GetNewPlainForceOfDuration(duration int) *Force

func (*Force) Add

func (f *Force) Add(f2 *Force) *Force

func (*Force) Copy

func (f *Force) Copy() *Force

func (*Force) GetAcc

func (f *Force) GetAcc(mass float64) *Vector

func (*Force) GetForceVec

func (f *Force) GetForceVec() *Vector

func (*Force) GetInfos

func (f *Force) GetInfos() string

func (*Force) IsActive

func (f *Force) IsActive() bool

func (*Force) SetForceVec

func (f *Force) SetForceVec(v *Vector)

type ForceUpdater

type ForceUpdater func(f *Force)

type Vector

type Vector struct {
	X, Y, Z float64
}

func (*Vector) Absolute

func (v *Vector) Absolute() float64

func (*Vector) Add

func (v *Vector) Add(B *Vector) *Vector

func (*Vector) Copy

func (v *Vector) Copy() *Vector

func (*Vector) CrossProduct

func (v *Vector) CrossProduct(B *Vector) *Vector

func (*Vector) DotProduct

func (v *Vector) DotProduct(B *Vector) (product float64)

func (*Vector) Equals

func (v *Vector) Equals(B *Vector) bool

func (*Vector) GetInfos

func (v *Vector) GetInfos() string

func (*Vector) GetRotationXY

func (v *Vector) GetRotationXY() (angle float64)

func (*Vector) IsFilled

func (v *Vector) IsFilled() bool

func (*Vector) Mul

func (v *Vector) Mul(num float64) *Vector

func (*Vector) Normalize

func (v *Vector) Normalize() *Vector

func (*Vector) Rotate

func (v *Vector) Rotate(axis *Vector, angle float64) *Vector

func (*Vector) RotateAbs

func (v *Vector) RotateAbs(axis *Vector, angle float64) *Vector

func (*Vector) Sub

func (v *Vector) Sub(B *Vector) *Vector

Jump to

Keyboard shortcuts

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