Module
Data.Vector3
- Package
- purescript-vectors
- Repository
- thought2/purescript-vectors
Types
Constructors
Destructors
Vector Modifiers
Componentwise Operations
Component Modifiers
Lens API
#Vec Source
data Vec a
Polymorphic 3D vector
Constructors
Vec a a a
Instances
Generic (Vec a) _
(Eq a) => Eq (Vec a)
(Ord a) => Ord (Vec a)
Functor Vec
Foldable Vec
Traversable Vec
(Show a) => Show (Vec a)
(Semiring a) => Semiring (Vec a)
Componentwise
Semiring
implementation> Vec 2 3 7 * Vec 4 5 2 Vec 8 15 14
(Ring a) => Ring (Vec a)
Applicative Vec
Apply Vec
Zippy
Apply
implementation> (<>) <$> Vec "A" "B" "C" <*> Vec "1" "2" "3" Vec "A1" "B2" "C3"
#vdiv Source
vdiv :: forall a. EuclideanRing a => Vec a -> Vec a -> Vec a
Divides two vectors componentwise.
This exists because there cannot be an EuclideanRing
instance for Vec
> vdiv (Vec 9 6 4) (Vec 3 2 4)
Vec 3 3 1
#vmod Source
vmod :: forall a. EuclideanRing a => Vec a -> Vec a -> Vec a
Componentwise Modulo operation
This exists because there cannot be an EuclideanRing
instance for Vec
> mod (Vec 12 120 1200) (Vec 120 100 1000)
Vec 2 20 200
#half Source
half :: forall a. EuclideanRing a => Vec a -> Vec a
Halves the amount of each component
> half (Vec 10 100 1000)
Vec 5 50 500
#twice Source
twice :: forall a. EuclideanRing a => Vec a -> Vec a
Duplicates the amount of each component
> twice (Vec 10 100 1000)
Vec 20 200 2000
- Modules
- Data.
Vector2 - Data.
Vector3
Creates a vector from three components