T-FLEX Parametric CAD. Fundamentals. 2D Design

T-FLEX Parametric CAD. Fundamentals. 2D Design T-FLEX Parametric CAD. Fundamentals. 2D Design

scp.s.scptuj.mb.edus.si
from scp.s.scptuj.mb.edus.si More from this publisher
30.07.2013 Views

Variables -23 % -5 = -3 23 % -5 = 3 -23 % 5 = -3 The result of the operation member1 % member2 is the remainder of dividing member1 by member2. The value of member2 may not be zero. In the case member2 = 0, the error occurs, “Zero divide in line 1”. Besides the above-mentioned algebraic operations, logical (comparison) operations can be used in expressions. The result of a logical operation is the numerical value 1, if the relation defined by the operation is true, and 0 otherwise. Logical Operations Greater than ( > ) Less than ( < ) Greater than or equal ( >= ) Less than or equal ( 45 && 56 < 34 This example expresses the question: Is the number 23 greater than the number 45 and the number 56 less than the number 34? Obviously, the answer will be - no, therefore the value of this expression is zero. The expression !VAR_1 is the same as VAR_1 == 0 Logical operations are usually used for comparing the value of a variable against a constant or a value of another variable. A shortcoming here is that only two values are possible as the result of evaluating a logical expression - 0 or 1. Another form of using logical operations is a conditional statement. A conditional statement has the following structure: condition ? value1 : value2 Example: VAR_1 > 100 ? 1 : -1 If the value of VAR_1 is greater than 100, then the statement will yield 1, otherwise it yields -1. One can use arbitrary expressions for the condition, value1 and value2. VAR_1 ? 1 : -1 or, just the same thing, VAR_1 != 0 ? 1 : -1 (VAR_1 != 0 && VAR_2 == 0) ? (VAR_3 + 1) : (VAR_4 -1) 495

Fundamentals. Two-Dimensional Design Standard Mathematical Functions 496 ABS Return absolute value of abs ( -20 ) = 20 ACOS Calculate arccosine acos ( 0.5 ) = 60 ASIN Calculate arcsine asin ( 0.5 ) = 30 ATAN Calculate arctangent atan ( 1 ) = 45 CEIL Find integer ceiling ceil ( 3.98 ) = 4 COS Calculate cosine cos ( 60 ) = 0.5 FLOOR Find largest integer less than or equal to argument floor ( 3.13 ) = 3 HYPOT Calculate hypotenuse of right triangle hypot ( 3, 4 ) = 5 INT Round to nearest integer int ( 3.13 ) = 3 LOG Calculate natural logarithm log ( 1 ) = 0 LOG10 Calculate base-10 logarithm log10 ( 10 ) = 1 RACOS Calculate arccosine, in radians racos ( 0.5 ) = 1.0472 RASIN Calculate arcsine, in radians rasin ( 1 ) = 1.5708 RATAN Calculate arctangent, in radians ratan ( 2 ) = 1.10715 RCOS Calculate cosine, angle input in radians ROUND( ARG1, ARG2 ) Round the value ARG1 with accuracy ARG2. rcos ( 1 ) = 0.540302 Round 2.25 ( 2.357, 0.25 ) = Round ( 2.357, 0.1 ) = 2.4 RSIN Calculate sine, angle input in radians rsin ( 1 ) = 0.841741 RTAN Calculate tangent, angle input in radians rtan ( 1 ) = 1.55741 SIN Calculate sine sin ( 30 ) = 0.5 SQRT Find square root sqrt ( 16 ) = 4 TAN Calculate tangent tan ( 45 ) = 1 All functions except hypot and ROUND have one numerical argument. Function arguments can be substituted by any expression, including other function calls that result in real numbers. SIN ( 10 + 10 + 10 ) = 0.5 SIN ( SQRT ( 900 ) ) = 0.5 The functions hypot and ROUND have two numerical arguments separated by a comma: HYPOT ( 1 + 1 + 1, 1 + 1 + 1 + 1 ) = 5

<strong>Fundamentals</strong>. Two-Dimensional <strong>Design</strong><br />

Standard Mathematical Functions<br />

496<br />

ABS Return absolute value of abs ( -20 ) = 20<br />

ACOS Calculate arccosine acos ( 0.5 ) = 60<br />

ASIN Calculate arcsine asin ( 0.5 ) = 30<br />

ATAN Calculate arctangent atan ( 1 ) = 45<br />

CEIL Find integer ceiling ceil ( 3.98 ) = 4<br />

COS Calculate cosine cos ( 60 ) = 0.5<br />

FLOOR Find largest integer less than or equal<br />

to argument<br />

floor ( 3.13 ) = 3<br />

HYPOT Calculate hypotenuse of right triangle hypot ( 3, 4 ) = 5<br />

INT Round to nearest integer int ( 3.13 ) = 3<br />

LOG Calculate natural logarithm log ( 1 ) = 0<br />

LOG10 Calculate base-10 logarithm log10 ( 10 ) = 1<br />

RACOS Calculate arccosine, in radians racos ( 0.5 ) = 1.0472<br />

RASIN Calculate arcsine, in radians rasin ( 1 ) = 1.5708<br />

RATAN Calculate arctangent, in radians ratan ( 2 ) = 1.10715<br />

RCOS Calculate cosine, angle input in<br />

radians<br />

ROUND(<br />

ARG1,<br />

ARG2 )<br />

Round the value ARG1 with accuracy<br />

ARG2.<br />

rcos ( 1 ) = 0.540302<br />

Round<br />

2.25<br />

( 2.357, 0.25 ) =<br />

Round ( 2.357, 0.1 ) = 2.4<br />

RSIN Calculate sine, angle input in radians rsin ( 1 ) = 0.841741<br />

RTAN Calculate tangent, angle input in<br />

radians<br />

rtan ( 1 ) = 1.55741<br />

SIN Calculate sine sin ( 30 ) = 0.5<br />

SQRT Find square root sqrt ( 16 ) = 4<br />

TAN Calculate tangent tan ( 45 ) = 1<br />

All functions except hypot and ROUND have one numerical argument. Function arguments can be<br />

substituted by any expression, including other function calls that result in real numbers.<br />

SIN ( 10 + 10 + 10 ) = 0.5<br />

SIN ( SQRT ( 900 ) ) = 0.5<br />

The functions hypot and ROUND have two numerical arguments separated by a comma:<br />

HYPOT ( 1 + 1 + 1, 1 + 1 + 1 + 1 ) = 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!