# Relation to vary number of cut instances

#### Freecat

##### Member
I am trying to setup a relation in my model that will automatically vary the number of cuts (in a pattern) along the length of my part as the model changes in length. Can anyone give the syntax for this type of relation? Will it be necessary to make the the calculated number a whole number before inputing it into the patten variable for the number of cuts? I would assume you would need to make that number a whole number as entering decimals isn't allowed in a pattern for the number of instances. The pitch of my cuts are .265, and my plan is to always allow for the max number of complete cuts along the length of my part.

Any help appreciated!

#### charleskim

##### Member
Hello Freecat,

Try below.

Where 'P0' is number of cuts, 'LENGTH' is overall length of part,

'PITCH' is pitch of cut (in your case .265).

P0 = FLOOR(LENGTH/PITCH)+1

#### Freecat

##### Member
Thanks for the reply, what does floor represent? If I understand the formula this is what is happening:

P0 = LENGTH/PITCH * FLOOR+1

Free

#### charleskim

##### Member
'Floor' is a fuction, it takes a number and make it into a interger.

i.e. floor(23.45) becomes (23).

#### Freecat

##### Member
Here is what I came up with for the relation, works perfect.

P30=FLOOR((D4+(D59*2))/.2645)+1

To specify the order of arithmetic operations, I used multiple sets of parenthesis. Is this the proper way of specifying the order? Here is what is happening in the model, it must be right because it works!

1. D59 is multiplied by 2

3. The value is now divided by the pitch of the cut, .2645

4. 1 is added (to make the cut work out right)

5. The results are then changed to an integer via the FLOOR function Currious why PTC calls it FLOOR, any ideas? That terminology makes no sense to me...

Thanks

#### kvision

##### Moderator
FLOOR and CEIL (ceiling) are C programming functions. Since Pro and most other things are written in C it probably makes sense to use appropriate terminology.

Relations may include the following mathematical functions:

cos ()

cosine

tan ()

tangent

sin ()

sine

sqrt ()

square root

asin ()

arc sine

acos ()

arc cosine

atan ()

arc tangent

sinh ()

hyperbolic sine

cosh ()

hyperbolic cosine

tanh ()

hyperbolic tangent

Note: All trigonometric functions use degrees.

log()

base 10 logarithm

ln()

natural logarithm

exp()

e to an exponential degree

abs()

absolute value

ceil()

the smallest integer not less than the real value

floor()

the largest integer not greater than the real value

The following examples show ceil and floor used without specifying number of decimal places:

ceil (10.2) evaluates to 11

floor (

#### Freecat

##### Member
Thank for the help