ms1

package
v0.0.0-...-a2463fe Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 1 Imported by: 3

Documentation

Overview

package ms1 implements basic 1D math useful for 3D graphics applications. Functions in this package have their OpenGL equivalent which is usually of the same name.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(v, Min, Max float32) float32

Clamp returns value v clamped between Min and Max.

func Interp

func Interp(x, y, a float32) float32

Interp performs the linear interpolation between x and y, mapping with a in interval [0,1]. This function is known as "mix" in OpenGL.

func Sign

func Sign(x float32) float32

Sign returns -1, 0, or 1 for negative, zero or positive x argument, respectively, just like OpenGL's "sign" function.

func SmoothStep

func SmoothStep(edge0, edge1, x float32) float32

SmoothStep performs smooth cubic hermite interpolation between 0 and 1 when edge0 < x < edge1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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