This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0

OpenSolid.WebGLMath.Point3d

Transformation functions for Point3d.

transformBy : Float4x4 -> Point3d -> Point3d

Transform a Point3d by a Float4x4;

Point3d.transformBy matrix point

is equivalent to

Point3d (Matrix4.transform matrix (Point3d.coordinates point))

For example:

point =
    Point3d ( 2, 1, 3 )

matrix =
    Matrix4.makeTranslate ( 3, 4, 5 )

Point3d.transformBy matrix point
--> Point3d ( 5, 5, 8 )
module OpenSolid.WebGLMath.Point3d
    exposing
        ( transformBy
        )

{-| Transformation functions for `Point3d`.

@docs transformBy

-}

import OpenSolid.Geometry.Types exposing (..)
import OpenSolid.Point3d as Point3d
import Matrix4 exposing (Float4x4)


{-| Transform a `Point3d` by a `Float4x4`;

    Point3d.transformBy matrix point

is equivalent to

    Point3d (Matrix4.transform matrix (Point3d.coordinates point))

For example:

    point =
        Point3d ( 2, 1, 3 )

    matrix =
        Matrix4.makeTranslate ( 3, 4, 5 )

    Point3d.transformBy matrix point
    --> Point3d ( 5, 5, 8 )

-}
transformBy : Float4x4 -> Point3d -> Point3d
transformBy matrix point =
    Point3d (Matrix4.transform matrix (Point3d.coordinates point))