-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Richard Motorgeanu edited this page Mar 7, 2023
·
1 revision
This'll document everything for the internal usage of the library.
Most functionality will come from Messages being sent to the model, however there will be other helpful functions!
Hope this helps!
Richie
WIP
- Adds a Vector2D to a grid.
- Paramaters
- Vector2D: The vector to add to the grid.
- Int: The ID of the grid.
AddVector2D Vector2D Int
- Adds a Vector2D to a grid.
- Paramaters
- Vector2D: The vector to add to the grid.
- Int: The ID of the grid.
RemoveVector2D Int Int
- Removes a Vector2D from a grid.
- Paramaters
- Int: The ID of the vector.
- Int: The ID of the grid.
ScaleVector2D Float Int Int
- Scales a Vector2D on a grid by a given value.
- Paramaters
- Float: The scalar value to scale the vector by.
- Int: The ID of the vector.
- Int: The ID of the grid.
AddGrid2D Grid2D
- Adds the Grid2D.
- Paramaters
- Grid2D: The grid to add.
RemoveGrid2D Int
- Removes the Grid2D with the given ID.
- Paramaters
- Int: The ID of the grid.
type alias Coordinate2D : (Float, Float)
defaultCoordinate2D = (0, 0)
type alias Vector2D : (Float, Float)
defaultVector2D = (0, 0)
type alias Matrix2D : List Vector2D
defaultMatrix2D = [ (0, 0)
, (0, 0) ]
identityMatrix2D = [ (1, 0)
, (0, 1) ]
type LineType = Solid Float
| Dotted Float
| Dashed Float
| Directional Float
| Bidirectional Float
defaultLineType = Solid 1
type alias Grid2D =
{ transformationMatrix : Matrix2D
, vectorObjects : Dict Int Vector2D
, xColor : Color
, yColor : Color
, xLineType : LineType
, yLineType : LineType
, scale : Float
, offset : Coordinate2D
}
defaultGrid2D =
{ transformationMatrix = defaultMatrix2D
, vectorObjects = Dict.empty
, xColor = black
, yColor = black
, xLineType = defaultLineType
, yLineType = defaultLineType
, scale = 5
, offset = (0, 0)
}