# Calculator

Mathematically operates on values based on the current settings, and gives the result as an output. The face of the gadget displays the mode the calculator is in.

# **Looping**:
When wiring from a calculator into the same calculator,
the output going through that wire
will be used as the input on the next frame only.

This means while using the Add operation,
we can wire Result into one of the operands.
Then for every frame the other operand has a value,
that value is added to the result.
And the result is preserved indefinitely.
Turning the calculator off will reset all values,
and so all sent values, and the looped received value
to **0**.
(Tg)

This also means if we wire one operand into the other, the first will contain the current value and the second will contain the previous frame's value. This is useful for comparing the current value with the previous value, detecting a change, etc. (Tg)

# **Operating on Fat Wires**:
Fat wires
will have all values
affected using the corresponding
values from both operands.
(Tg)
(Tg)

For example, adding the wire 2 Numbers(1, 2)to 2 Numbers(3, 4)will perform (1 + 3,2 + 4); outputting the wire 2 Numbers(4, 6).

If one operand is a fat wire value and one is a thin wire or single value, all components of the fat wire will be operated upon. (Tg)

**Two Dates**:
When two Time/Date values are wired into the two operands,
some operations will output operand A.
Other operations will make the calculation between
their Default Values
as normal, and output a date value with the result
as its default value.

**Memory**:
Costs 0.0061%
of the things limit per gadget.

## # Standard Tab

### # Operand 1

The first value/operand. (Tg)

When a wire is plugged in, shows the “default” value of the wire. (Tg) But will operate on the all values within the wire. (Tg)

An 8 Numbers wire will only have its first component operated on unless both values are 8 Numbers wires.

When a Time/Date is wired into either operand input its full date and time are shown.

### # Standard Operation

The type of operation to perform using the values. (Jj)

### # Operand 2

### # Result

Outputs the result of the calculation.

## # Trigonometric Tab

When using these operations on Time/Date wires, outputs the value of the wire plugged into Operand 1.

### # Operand A, Operand B, Result

### # Trigonometric Function

Trigonometric functions describing the relationship between sides of a triangle and the angles of the corners of the triangle. (See Wikipedia for more information.)

I envision these functions as describing the relationship
between a 2D point’s position and its angles.
This forms a right-angled triangle by drawing a line
from **(0,0)** to the point, down to the X axis,
and back to **(0,0)**.

In terms of traditional trigonometry labelling,
the angle would be between the x-axis round to the line to the point.
The horizontal line at the bottom would be known as the “adjacent,”
and its length is the same as the point’s X coordinate.
The vertical line on the right would be known as the “opposite,”
and its length is the same as the point’s Y coordinate.
The line to the point would be known as the “hypotenuse,”
and its length is the same as the point’s distance from **(0,0)**.
So then the SOH-CAH-TOA memorisation technique still holds.

I’ll use the idea of a 2D point as a way of describing what the functions output.

### # Radians

Angle inputs should be in radians.
Angle outputs are also in radians.
(Tg)
**180 degrees = PI radians**

So to convert:
**degrees × PI ÷ 180 = radians**.
**radians × 180 ÷ PI = degrees**.

## # Vectors Tab

A vector is a collection of multiple numbers.
Normally used to define a position on a grid or graph.
Or, if the distance from the **(0,0)** position is **1**,
this can be referred to as a “direction.”
(Tg)

A 3D vector has 3 numbers representing the axes X, Y, and Z. These can be represented as the 3 Numbers wire type.

A 2D vector has 2 numbers. These can be represented as 2 Numbers or Left/Right Stick wire types.

### # Operand A, Operand B, Result

### # Vector Function

A function to apply to the vector operands.

Any operands used by these functions should be vectors. Vectors are 2 Numbers, 3 Numbers values (commonly used for positions and directions). And 4 Numbers or 8 Numbers values.

The “origin” vector for any operation would be a vector of the same type, with all components set to 0. If this were a position, it would be the “origin” of the scene.

# # Wide Calculator

Starts with the first wired value, and operates on it with the next wired value, and so on until all available and wired operands have been used. (Ml)

**Memory**:
Costs 0.0061%
of the Things limit
per gadget.

## Tweak Menu

### # Operation

What operation to apply to all values.

### # Number of Ports

How many operands will be processed.

### # Operands

Wired operands to process.

### # Result

The result of operating on all values.