package
Version:
v0.5.1
Opens a new window with list of versions in this module.
Published: Jan 1, 2021
License: Zlib
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
xmath
Package xmath provides mathematics routines convenient to xirho and its components.
Currently, this provides the RNG implementation and some helpers for coordinate systems.
Documentation
¶
Package xmath provides mathematics routines convenient to xirho and its components.
-
func Angle(x float64) float64
-
func FromSpherical(r, theta, phi float64) (x, y, z float64)
-
func IsFinite(x float64) bool
-
func R3(x, y, z float64) float64
-
func Spherical(x, y, z float64) (r, theta, phi float64)
-
type RNG
Angle wraps a float64 value to the interval (-pi, pi]. The result may be NaN
if the argument is not finite.
FromSpherical converts spherical (r, θ, φ) coordinates to rectangular
(x, y, z).
IsFinite returns whether the argument is finite.
R3 calculates the Euclidean distance from the origin to the given point.
Spherical converts rectangular (x, y, z) coordinates to spherical (r, θ, φ).
RNG is the randomness source type for xirho, an implementation of
xoshiro256** by David Blackman and Sebastiano Vigna.
NewRNG produces a new, uniquely seeded RNG.
Intn produces an int in [0, n). Panics if n <= 0.
Jump quickly advances the generator by 2**192 steps.
Normal generates a variate from the standard normal distribution.
Uint64 produces a 64-bit pseudo-random value.
Uniform generates a number in the interval [0, 1).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.