Presentation links page for lesson three. 3 Arithmetic functions. Introduction to arithmetic. Basic functions (+, , *, /). Combining operations. Trigonometry functions. Square root Absolute value. ROUND FIX FUP (rounding functions). Priority of arithmetic operators. Example.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Presentation links page for lesson three
3 Arithmetic functions
Introduction to arithmetic
Basic functions (+, , *, /)
Combining operations
Trigonometry functions
Square root Absolute value
ROUNDFIXFUP(rounding functions)
Priority of arithmetic operators
Example
Just about anything that can be done on a scientific calculator can be done in a custom macro program
Add
Subtract
Multiply
Divide
Square root
Logarithms
Sine
Cosine
Tangent
Arc tangent
Rounding
23
2
3
Introduction To ArithmeticFor those functions that are not included in custom macro:
Square:
23 times 23
Cube:
23 times 23 times 23
You can usually come up with a way to calculate longhand
Equality
Add
Subtract
Multiply
Divide
=
+

/
*
#100 = 4.
#101 = 2+2
#102 = 51
#103 = 2*2
#104 = 8/2
Variable #100 equals 4 in all expressions
You can combine operations into an expression
Multiplication has a higher priority than addition
6
#101 = 4 + 3 * 2
14
Again, multiplication is done first – otherwise the result would be 14
Combining operations
If you want to force the addition to be done first, use brackets to surround the addition operation
#101 = [4 + 3] * 2
7
More on brackets later
?
#102
Trigonometry FunctionsAngle needed
Side adjacent and hypotenuse known
Arc cosine
#103 = ACOS[#102/#101]
10
1.5
Trigonometry FunctionsSide opposite needed
Angle and side adjacent known
Tangent
#101 = TAN[10] * 1.5
?
#102
Trigonometry FunctionsAngle needed
Arc tangent
Side adjacent and side opposite known
#103 = ATAN[#101] / [#102]
Absolute value renders unsigned (positive) value
#101 = ABS[25]
Result:
#101 is set equal to 3.0
User could enter positive or negative value
Result is Z1.0, regardless of entry polarity
?
Z1.0
G65 P1000 … Z1.0 ...
O1000
.
.
.
G01 Z[ABS[#26]] F4.5
Result is next closest integer
#101 = ROUND[3.2]
#101 is set to 3
#101 = ROUND[3.8]
#101 is set to 4
0.69
=> original doc
Round Down (FIX)#17
Use FIX when you want to specify a MINIMUM depth of cut. The recalculated depth will always be GREATER than the specified value.
#7
#101 = FIX[#7/#17]
(5)
#17 = #7/#101
(0.138)
0.69
=< original doc
Round Up (FUP)#17
Use FUP when you want to specify a MAXIMUM depth of cut. The recalculated depth will always be LESS than the specified value.
#7
#101 = FUP[#7/#17]
(6)
#17 = #7/#101
(0.115)
2)
3)
4)
[ ]
Functions
* then /
+ then 
Priority Of Arithmetic OperationsHere is the full priority of arithmetic operations
Anything in brackets will be done first
Higher level functions (sine, cosine, etc) done second
Multiplication and division done third
Addition, then subtraction are done last