<commit_before>--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- This Source Code Form is subject to the terms of the Mozilla Public        --
-- License, v. 2.0. If a copy of the MPL was not distributed with this file,  --
-- you can obtain one at http://mozilla.org/MPL/2.0/.                         --
--                                                                            --
-- Copyright 2016 by <NAME>                                            --
-- <EMAIL>                                                  --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


module OpenSolid.Vector3d
    exposing
        ( zero
        , perpendicularTo
        , components
        , xComponent
        , yComponent
        , zComponent
        , componentIn
        , equalWithin
        , length
        , squaredLength
        , direction
        , lengthAndDirection
        , flip
        , scaleBy
        , sum
        , difference
        , dotProduct
        , crossProduct
        , rotateAround
        , mirrorAcross
        , projectionIn
        , projectOnto
        , relativeTo
        , placeIn
        , projectInto
        )

{-| <img src="https://opensolid.github.io/images/geometry/icons/vector3d.svg" alt="Vector3d" width="160">

Various functions for creating and working with `Vector3d` values. A `Vector3d`
is defined by its X, Y and Z components and represents a quantity like a
velocity or displacement in 3D.

The simplest way to create a `Vector3d` is by passing a tuple of X, Y and Z
components to the `Vector3d` constructor, for example

    vector =
        Vector3d ( 2, 1, 3 )

# Predefined vectors

@docs zero

Although there are no predefined constants for
<code>Vector3d&nbsp;(&nbsp;1,&nbsp;0,&nbsp;0&nbsp;)</code>,
<code>Vector3d&nbsp;(&nbsp;0,&nbsp;1,&nbsp;0&nbsp;)</code> and
<code>Vector3d&nbsp;(&nbsp;0,&nbsp;0,&nbsp;1&nbsp;)</code>, in most cases you
will actually want their `Direction3d` versions `Direction3d.x`, `Direction3d.y`
and `Direction3d.z`.

# Constructors

@docs perpendicularTo

# Components

@docs components, xComponent, yComponent, zComponent, componentIn

# Comparison
<commit_msg>Revamp Vector3d documentation intro<commit_after>--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- This Source Code Form is subject to the terms of the Mozilla Public        --
-- License, v. 2.0. If a copy of the MPL was not distributed with this file,  --
-- you can obtain one at http://mozilla.org/MPL/2.0/.                         --
--                                                                            --
-- Copyright 2016 by <NAME>                                            --
-- <EMAIL>                                                  --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


module OpenSolid.Vector3d
    exposing
        ( zero
        , perpendicularTo
        , components
        , xComponent
        , yComponent
        , zComponent
        , componentIn
        , equalWithin
        , length
        , squaredLength
        , direction
        , lengthAndDirection
        , flip
        , scaleBy
        , sum
        , difference
        , dotProduct
        , crossProduct
        , rotateAround
        , mirrorAcross
        , projectionIn
        , projectOnto
        , relativeTo
        , placeIn
        , projectInto
        )

{-| <img src="https://opensolid.github.io/images/geometry/icons/vector3d.svg" alt="Vector3d" width="160">

A `Vector3d` represents a quantity such as a displacement or velocity in 3D, and
is defined by its X, Y and Z components. This module contains a variety of
vector-related functionality, such as

  - Adding or subtracting vectors
  - Finding the lengths of vectors
  - Rotating vectors
  - Converting vectors between different coordinate systems

Note that unlike in many other geometry packages where vectors are used as a
general-purpose data type, OpenSolid has separate data types for vectors,
directions and points. In most code it is actually more common to use `Point3d`
and `Direction3d` than `Vector3d`, and much code can avoid working directly with
`Vector3d` values at all!

The simplest way to create a `Vector3d` is by passing a tuple of X, Y and Z
components to the `Vector3d` constructor, for example

    vector =
        Vector3d ( 2, 1, 3 )

# Predefined vectors

@docs zero

Although there are no predefined constants for
<code>Vector3d&nbsp;(&nbsp;1,&nbsp;0,&nbsp;0&nbsp;)</code>,
<code>Vector3d&nbsp;(&nbsp;0,&nbsp;1,&nbsp;0&nbsp;)</code> and
<code>Vector3d&nbsp;(&nbsp;0,&nbsp;0,&nbsp;1&nbsp;)</code>, in most cases you
will actually want their `Direction3d` versions `Direction3d.x`, `Direction3d.y`
and `Direction3d.z`.

# Constructors

@docs perpendicularTo

# Components

@docs components, xComponent, yComponent, zComponent, componentIn

# Comparison

{'fraction_non_alphanumeric': 0.19981006647673313, 'fraction_numerical': 0.01557454890788224, 'mean_word_length': 1.4345815996301434, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7527436', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1230, 'n_words': 420}