implicit-0.4.0.0: A math-inspired programmatic 2D & 3D CAD system.
Safe HaskellNone
LanguageHaskell2010

Graphics.Implicit.MathUtil

Synopsis

Documentation

rmax Source #

Arguments

::

radius

->

first number to round maximum

->

second number to round maximum

->

resulting number

Rounded Maximum Consider max(x,y) = 0, the generated curve has a square-like corner. We replace it with a quarter of a circle

NOTE: rmax is not associative!

rmaximum Source #

Arguments

::

radius

-> []

numbers to take round maximum

->

resulting number

Like rmax, but on a list instead of two. Just as maximum is. The implementation is to take the maximum two and rmax those.

rminimum Source #

Arguments

::

radius

-> []

numbers to take round minimum

->

resulting number

Like rmin but on a list.

distFromLineSeg :: ℝ2 -> (ℝ2, ℝ2) -> Source #

The distance a point p is from a line segment (a,b)

pack Source #

Arguments

:: Box2

The box to pack within

->

The space seperation between items

-> [(Box2, a)]

Objects with their boxes

-> ([(ℝ2, a)], [(Box2, a)])

Packed objects with their positions, objects that could be packed

Pack the given objects in a box the given size.

reflect Source #

Arguments

:: (Num (f a), Fractional a, Metric f) 
=> f a

Mirror axis

-> f a

Vector to transform

-> f a 

Reflect a vector across a hyperplane defined by its normal vector.

From https://en.wikipedia.org/wiki/Reflection_(mathematics)#Reflection_through_a_hyperplane_in_n_dimensions

alaV3 :: (V3 a -> V3 a) -> (a, a, a) -> (a, a, a) Source #

Lift a function over V3 into a function over ℝ3.

packV3 :: (a, a, a) -> V3 a Source #

unpackV3 :: V3 a -> (a, a, a) Source #

infty :: Fractional t => t Source #

Haskell's standard library doesn't make floating-point infinity available in any convenient way, so we define it here.