Maintainer | diagrams-discuss@googlegroups.com |
---|---|

Safe Haskell | None |

Transformations specific to three dimensions, with a few generic transformations (uniform scaling, translation) also re-exported for convenience.

- aboutZ :: Angle a => a -> T3
- aboutX :: Angle a => a -> T3
- aboutY :: Angle a => a -> T3
- rotationAbout :: (Angle a, Direction d) => P3 -> d -> a -> T3
- pointAt :: Direction d => d -> d -> d -> T3
- pointAt' :: R3 -> R3 -> R3 -> T3
- scalingX :: Double -> T3
- scaleX :: (Transformable t, V t ~ R3) => Double -> t -> t
- scalingY :: Double -> T3
- scaleY :: (Transformable t, V t ~ R3) => Double -> t -> t
- scalingZ :: Double -> T3
- scaleZ :: (Transformable t, V t ~ R3) => Double -> t -> t
- onBasis :: T3 -> ((R3, R3, R3), R3)

# Documentation

aboutZ :: Angle a => a -> T3Source

Create a transformation which rotates by the given angle about a line parallel the Z axis passing through the local origin. A positive angle brings positive x-values towards the positive-y axis.

The angle can be expressed using any type which is an
instance of `Angle`

. For example, ```
aboutZ (1/4 ::
```

, `Turn`

)`aboutZ (tau/4 :: `

, and `Rad`

)```
aboutZ (90 ::
```

all represent the same transformation, namely, a
counterclockwise rotation by a right angle. For more general rotations,
see `Deg`

)`rotationAbout`

.

Note that writing `aboutZ (1/4)`

, with no type annotation, will
yield an error since GHC cannot figure out which sort of angle
you want to use.

aboutX :: Angle a => a -> T3Source

Like `aboutZ`

, but rotates about the X axis, bringing positive y-values
towards the positive z-axis.

aboutY :: Angle a => a -> T3Source

Like `aboutZ`

, but rotates about the Y axis, bringing postive
x-values towards the negative z-axis.

:: (Angle a, Direction d) | |

=> P3 | origin of rotation |

-> d | direction of rotation axis |

-> a | angle of rotation |

-> T3 |

`rotationAbout p d a`

is a rotation about a line parallel to `d`

passing through `p`

.

pointAt :: Direction d => d -> d -> d -> T3Source

`pointAt about initial final`

produces a rotation which brings
the direction `initial`

to point in the direction `final`

by first
panning around `about`

, then tilting about the axis perpendicular
to initial and final. In particular, if this can be accomplished
without tilting, it will be, otherwise if only tilting is
necessary, no panning will occur. The tilt will always be between
± /4 turn.

pointAt' :: R3 -> R3 -> R3 -> T3Source

pointAt' has the same behavior as `pointAt`

, but takes vectors
instead of directions.

scalingX :: Double -> T3Source

Construct a transformation which scales by the given factor in the x direction.

scaleX :: (Transformable t, V t ~ R3) => Double -> t -> tSource

Scale a diagram by the given factor in the x (horizontal)
direction. To scale uniformly, use `scale`

.

scalingY :: Double -> T3Source

Construct a transformation which scales by the given factor in the y direction.

scaleY :: (Transformable t, V t ~ R3) => Double -> t -> tSource

Scale a diagram by the given factor in the y (vertical)
direction. To scale uniformly, use `scale`

.

scalingZ :: Double -> T3Source

Construct a transformation which scales by the given factor in the z direction.