rnd

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rnd

type Rnd struct {
	*rand.Rand
}

Rnd is extencion of rand.Rand, it adds some utility methods relevant for mat package

func New

func New(seed int64) Rnd

New creates new Rnd with given seed

func Time

func Time() Rnd

Time returns Rnd seeded by current time

func (*Rnd) AABB

func (r *Rnd) AABB(a mat.AABB) mat.Vec

AABB returns random point contained in aabb

func (*Rnd) Angle

func (r *Rnd) Angle() float64

angle returns random angle in range <-Pi, Pi>

func (*Rnd) Circ

func (r *Rnd) Circ(c mat.Circ) mat.Vec

Circ returns random point in given circle

func (*Rnd) Range

func (r *Rnd) Range(min, max float64) float64

Range returns point in given range

func (*Rnd) Ray

func (r *Rnd) Ray(ray mat.Ray) mat.Vec

Ray returns random point on ray

Jump to

Keyboard shortcuts

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