Skip to content

Commit

Permalink
Figured out TOCs for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sebjameswml committed Oct 7, 2024
1 parent 4ee5e3f commit 22ecd38
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 41 deletions.
15 changes: 12 additions & 3 deletions docs/ref/coremaths/quat.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ permalink: /ref/coremaths/quaternion/
nav_order: 7
---
## A Quaternion implementation
{: .no_toc }

- TOC
{:toc}

## Header

```c++
#include <morph/Quaternion.h>
```
Expand All @@ -24,7 +31,7 @@ where `Flt` hints that the template arg is a floating point type. The Hamiltonia
## Create a Quaternion:
## Create a Quaternion
```c++
morph::Quaternion<float> q; // By default w=1, and x, y, z = 0;
Expand All @@ -41,15 +48,17 @@ morph::Quaternion<float> q (z_axis, angle); // The (axis, angle) constructor
```
## Copy a Quaternion:
## Copying
```c++
morph::Quaternion<float> q1;
morph::Quaternion<float> q2 = q1; // Assignment works as expected
```

You can use **equality** and **inequality operators** on a Quaternion: `q1 == q2` and `q1 != q2`.

## Stream a Quaternion:
## Streaming

You can stream a Quaternion object:
```c++
morph::Quaternion<float> q1(1, 0, 0, 0);
std::cout << q1 << std::endl;
Expand Down
14 changes: 11 additions & 3 deletions docs/ref/coremaths/scale.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ layout: page
permalink: /ref/coremaths/scale
nav_order: 5
---
# morph::Scale
{: .no_toc}

```c++
#include <morph/Scale.h>
```
Header file: [morph/Scale.h](https://github.com/ABRG-Models/morphologica/blob/main/morph/Scale.h). Test code: [tests/testScale](https://github.com/ABRG-Models/morphologica/blob/main/tests/testScale.cpp) [tests/testScaleVector](https://github.com/ABRG-Models/morphologica/blob/main/tests/testScaleVector.cpp)

**Table of Contents**

- TOC
{:toc}

## Summary

In any computer visualization system, you'll soon need a way to scale numbers. If you're graphing a data set, you'll need to scale the values, whose [range](/morphologica/ref/coremaths/range) may be from 0 to 10<sup>6</sup>, so that they fit into a graph in your 3D environment whose height is 1. Likewise, all the colour maps in morphologica take input in the range [0,1] and if you want to make a quiver plot, you're likely to need to scale the length of the vectors you're going to render.
Expand Down Expand Up @@ -82,13 +90,13 @@ morph::vvec<float> result(vi.size()); // Output/transformed data in float ty
s.transform (vi, result);
```

You can autoscale from a data set, finding the scaling parameters, without also transforming the data with `autoscale_from`:
You can autoscale from a data set, finding the scaling parameters, without also transforming the data with `compute_scaling_from_data`:

```c++
morph::Scale<int, float> s;
s.do_autoscale = true;
morph::vvec<int> vi = {1,2,3,4,5,8,9,18};
s.autoscale_from (vi); // s.transform (anydata) can now be called
s.compute_scaling_from_data (vi); // s.transform (anydata) can now be called
```
Note that subsequent calls to `transform` will use the scaling parameters obtained from the first call! If you want to autoscale each new data set, then you have to reset `do_autoscale` back to true with `reset`:
Expand All @@ -113,7 +121,7 @@ You may not always wish to scale your input data to the range [0,1]. To modify t
morph::Scale<int, float> s;
s.output_range.min = 1.0f;
s.output_range.max = 2.0f;
s.do_autoscale = true; // autoscale_from() or transform() will scale output to range [1,2]
s.do_autoscale = true; // transform() will scale output to range [1,2] by calling compute_scaling_from_data()
```

### Manually setting the scaling parameters
Expand Down
19 changes: 2 additions & 17 deletions docs/ref/coremaths/vec.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,8 @@ Header file: [morph/vec.h](https://github.com/ABRG-Models/morphologica/blob/main

**Table of contents**

* [Summary](/morphologica/ref/coremaths/vec/#summary)
* [Design](/morphologica/ref/coremaths/vec/#design)
* [Arithmetic operators](/morphologica/ref/coremaths/vec/#arithmetic-operators)
* [Assignment operators](/morphologica/ref/coremaths/vec/#assignment-operators)
* [Comparison operators](/morphologica/ref/coremaths/vec/#comparison-operators)
* [Member functions](/morphologica/ref/coremaths/vec/#member-functions)
- [Setter functions](/morphologica/ref/coremaths/vec/#setter-functions)
- [Numpy-like functions](/morphologica/ref/coremaths/vec/#numpy-clones)
- [Random numbers](/morphologica/ref/coremaths/vec/#random-numbers)
- [Plus-one/less-one dimension](/morphologica/ref/coremaths/vec/#plus-oneless-one-dimension)
- [Type conversions](/morphologica/ref/coremaths/vec/#type-conversions)
- [String output](/morphologica/ref/coremaths/vec/#string-output)
- [Length/lengthen/shorten](/morphologica/ref/coremaths/vec/#length-lengthen-shorten)
- [Range and renormalization](/morphologica/ref/coremaths/vec/#the-range-and-rescaling-or-renormalizing)
- [Finding elements](/morphologica/ref/coremaths/vec/#finding-elements)
- [Simple statistics](/morphologica/ref/coremaths/vec/#simple-statistics)
- [Maths functions](/morphologica/ref/coremaths/vec/#maths-functions)
- TOC
{:toc}

## Summary

Expand Down
19 changes: 2 additions & 17 deletions docs/ref/coremaths/vvec.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,8 @@ Header file: [morph/vvec.h](https://github.com/ABRG-Models/morphologica/blob/mai

**Table of contents**

* [Summary](/morphologica/ref/coremaths/vvec/#summary)
* [Design](/morphologica/ref/coremaths/vvec/#design)
* [Arithmetic operators](/morphologica/ref/coremaths/vvec/#arithmetic-operators)
* [Assignment operators](/morphologica/ref/coremaths/vvec/#assignment-operators)
* [Comparison operators](/morphologica/ref/coremaths/vvec/#comparison-operators)
* [Member functions](/morphologica/ref/coremaths/vvec/#member-functions)
- [Setter functions](/morphologica/ref/coremaths/vvec/#setter-functions)
- [Numpy-like functions](/morphologica/ref/coremaths/vvec/#numpy-clones)
- [Random numbers](/morphologica/ref/coremaths/vvec/#random-numbers)
- [Re-ordering elements](/morphologica/ref/coremaths/vvec/#re-ordering-elements)
- [Type conversions](/morphologica/ref/coremaths/vvec/#type-conversions)
- [String output](/morphologica/ref/coremaths/vvec/#string-output)
- [Length/lengthen/shorten](/morphologica/ref/coremaths/vvec/#length-lengthen-shorten)
- [Range and renormalization](/morphologica/ref/coremaths/vvec/#the-range-and-rescaling-or-renormalizing)
- [Finding elements](/morphologica/ref/coremaths/vvec/#finding-elements)
- [Simple statistics](/morphologica/ref/coremaths/vvec/#simple-statistics)
- [Maths functions](/morphologica/ref/coremaths/vvec/#maths-functions)
- TOC
{:toc}

## Summary

Expand Down
8 changes: 8 additions & 0 deletions docs/ref/visual/visual.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ permalink: /ref/visual/visual
layout: page
nav_order: 0
---
# `morph::Visual` -- the scene class
{: .no_toc}

```c++
#include <morph/Visual.h>
```

**Table of contents**

- TOC
{:toc}

# Overview

`morph::Visual<>` manages the graphical scene in which all your
Expand Down
9 changes: 8 additions & 1 deletion docs/ref/visual/visualmodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ permalink: /ref/visual/visualmodel
layout: page
nav_order: 2
---
# `VisualModel`: The base class for objects
{: .no_toc}

```c++
#include <morph/VisualModel.h>
```
**Table of Contents**

# `VisualModel`: The base class for objects
- TOC
{:toc}

# Overview

`morph::VisualModel` is the base class for graphical objects in your
`morph::Visual` scene. This page describes the base class and then
Expand Down

0 comments on commit 22ecd38

Please sign in to comment.