Functions: Difference between revisions

From Planimate Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
When editing an expression, type Ctrl-F to get a list of functions. If the cursor is after a ".", you get a list of Property Functions.
When editing an expression, type Ctrl-F to get a list of functions. If the cursor is after a ".", you get a list of Property Functions.


This page was generated using Planimate 5.32f.  
This page was generated using Planimate 8.99.0.  


<br> __TOC__  
__TOC__  


=== sqrt() ===
=== sqrt() ===


value = sqrt(value)  
value = sqrt(value)


Returns square root of 'value'.  
Returns square root of 'value'.


<br>


=== sqr() ===
=== sqr() ===


value = sqr(value)  
value = sqr(value)


Returns 'value' multiplied by itself.  
Returns 'value' multiplied by itself.


<br>


=== ceil() ===
=== ceil() ===


value = ceil(value)  
value = ceil(value)


Returns smallest integer greater or equal to 'value'.  
Returns smallest integer greater or equal to 'value'.


<br>


=== floor() ===
=== floor() ===


value = floor(value)  
value = floor(value)


Returns largest integer not greater than 'value'.  
Returns largest integer not greater than 'value'.


<br>


=== fabs() ===
=== fabs() ===


value = fabs(value)  
value = fabs(value)


Returns removes negative sign if 'value' is negative.  
Returns removes negative sign if 'value' is negative.


<br>


=== round() ===
=== round() ===


value = round(value)  
value = round(value)


Returns the nearest integer to 'value'.  
Returns the nearest integer to 'value'.


<br>


=== trunc() ===
=== trunc() ===


value = trunc(value)  
value = trunc(value)


Returns 'value' with the fraction trimmed off.  
Returns 'value' with the fraction trimmed off.


<br>


=== exp() ===
=== exp() ===


value = exp(value)  
value = exp(value)


Returns mathematical 'e' to the power of 'value'.  
Returns mathematical 'e' to the power of 'value'.


<br>


=== ln() ===
=== ln() ===


value = ln(value)  
value = ln(value)


Returns natural logarithm of 'value'.  
Returns natural logarithm of 'value'.


<br>


=== log10() ===
=== log10() ===


value = log10(value)  
value = log10(value)


Returns base 10 logarithm of 'value'.  
Returns base 10 logarithm of 'value'.


<br>


=== pow10() ===
=== pow10() ===


value = pow10(value)  
value = pow10(value)


Returns 10 to the power of 'value'.  
Returns 10 to the power of 'value'.


<br>


=== pow2() ===
=== pow2() ===


value = pow2(value)  
value = pow2(value)


Returns 2 to the power of 'value'.  
Returns 2 to the power of 'value'.


<br>


=== cos() ===
=== cos() ===


value = cos(value)  
value = cos(value)


Returns trigonometric cosine where 'value' is in radians.  
Returns trigonometric cosine where 'value' is in radians.


<br>


=== sin() ===
=== sin() ===


value = sin(value)  
value = sin(value)


Returns trigonometric sine where 'value' is in radians.  
Returns trigonometric sine where 'value' is in radians.


<br>


=== tan() ===
=== tan() ===


value = tan(value)  
value = tan(value)


Returns trigonometric tangent where 'value' is in radians.  
Returns trigonometric tangent where 'value' is in radians.


<br>


=== acos() ===
=== acos() ===


value = acos(value)  
value = acos(value)


Returns inverse of cos() function.  
Returns inverse of cos() function.


<br>


=== asin() ===
=== asin() ===


value = asin(value)  
value = asin(value)


Returns inverse of sin() function.  
Returns inverse of sin() function.


<br>


=== atan() ===
=== atan() ===


value = atan(value)  
value = atan(value)


Returns inverse of tan() function. atan2 is more useful if you have an x,y point.  
Returns inverse of tan() function. atan2 is more useful if you have an x,y point.


<br>


=== atan2() ===
=== atan2() ===


value = atan2(x,y)  
value = atan2(x,y)


Returns angle in radians between x axis and (x,y) on cartesian graph.  
Returns angle in radians between x axis and (x,y) on cartesian graph.


<br>


=== hypot() ===
=== hypot() ===


value = hypot(x,y)  
value = hypot(x,y)


Returns sqrt(x*x + y*y).  
Returns sqrt(x*x + y*y).


<br>


=== min() ===
=== min() ===


value = min(val1,val2)  
value = min(val1,val2)


Returns minimum of 'val1' and 'val2'.  
Returns minimum of 'val1' and 'val2'.


<br>


=== max() ===
=== max() ===


value = max(val1,val2)  
value = max(val1,val2)


Returns maximum of 'val1' and 'val2'.  
Returns maximum of 'val1' and 'val2'.


<br>


=== strlen() ===
=== strlen() ===


integer-value = strlen(string)  
integer-value = strlen(string)


Returns length of 'string'.  
Returns length of 'string'.


<br>


=== strleft() ===
=== strleft() ===


string = strleft(string,count)  
string = strleft(string,count)


Returns leftmost 'count' characters from 'string'.  
Returns leftmost 'count' characters from 'string'.


<br>


=== strmid() ===
=== strmid() ===


string = strmid(string,pos,count)  
string = strmid(string,pos,count)


Returns starting at 'pos' up to 'count' characters in 'string'.  
Returns starting at 'pos' up to 'count' characters in 'string'.


<br>


=== strright() ===
=== strright() ===


string = strright(string,count)  
string = strright(string,count)


Returns rightmost 'count' characters from 'string'.  
Returns rightmost 'count' characters from 'string'.


<br>


=== strreverse() ===
=== strreverse() ===


string = strreverse(string)  
string = strreverse(string)


Returns reversed order of characters in 'string'.  
Returns reversed order of characters in 'string'.


<br>


=== strupper() ===
=== strupper() ===


string = strupper(string)  
string = strupper(string)


Returns 'string' converted to lowercase.  
Returns 'string' converted to lowercase.


<br>


=== strlower() ===
=== strlower() ===


string = strlower(string)  
string = strlower(string)


Returns 'string' converted to uppercase.  
Returns 'string' converted to uppercase.


<br>


=== strcompare() ===
=== strcompare() ===


integer-value = strcompare(str1,str2[,casesensitive=0])  
integer-value = strcompare(str1,str2[,casesensitive=0])


Returns 0 if 'str1' and 'str2' are the same, 1 if 'str1' has higher ascii-sort order, -1 if 'str1' has lower ascii-sort order. Default is to ignore case unless casesensitive is provided and is not zero.  
Returns 0 if 'str1' and 'str2' are the same, 1 if 'str1' has higher ascii-sort order, -1 if 'str1' has lower ascii-sort order. Default is to ignore case unless casesensitive is provided and is not zero.


<br>


=== strfind() ===
=== strfind() ===


integer-value = strfind(str1,str2[,casesensitive=0])  
integer-value = strfind(str1,str2[,casesensitive=0])


Returns character where 'str2' first starts in 'str1' or 0 if not found.  
Returns character where 'str2' first starts in 'str1' or 0 if not found.


<br>


=== strclean() ===
=== strclean() ===


string = strclean(string)  
string = strclean(string)


Returns 'string' after leading spaces, trailing spaces, new lines and tabs have been removed. Any double quotes are made single.  
Returns 'string' after leading spaces, trailing spaces, new lines and tabs have been removed. Any double quotes are made single.


<br>


=== strinsert() ===
=== strinsert() ===


string = strinsert(str1,str2,pos)  
string = strinsert(str1,str2,pos)


Returns 'str1 with str2 inserted before character at position 'pos'.  
Returns 'str1 with str2 inserted before character at position 'pos'.


<br>


=== strdelete() ===
=== strdelete() ===


string = strdelete(string,pos,count)  
string = strdelete(string,pos,count)


Returns 'string' after deleteing 'count' characters starting at 'pos'.  
Returns 'string' after deleteing 'count' characters starting at 'pos'.


<br>


=== strreplace() ===
=== strreplace() ===


string = strreplace(string,str1,str2[,casesensitive=0])  
string = strreplace(string,str1,str2[,casesensitive=0])


Returns 'string' after all occurances of 'str1' are replaced with 'str2'. Match is not casesensitive unless 'casesensitive' is non zero.  
Returns 'string' after all occurances of 'str1' are replaced with 'str2'. Match is not casesensitive unless 'casesensitive' is non zero.


<br>


=== strchar() ===
=== strchar() ===


integer-value = strchar(string,pos)  
integer-value = strchar(string,pos)


Returns ASCII code of character at 'pos' of 'string'.  
Returns ASCII code of character at 'pos' of 'string'.


<br>


=== strasc() ===
=== strasc() ===


string = strasc(code)  
string = strasc(code)


Returns a single character string containing the given 8 bit ASCII character.  
Returns a single character string containing the given 8 bit ASCII character.


<br>


=== BitAnd() ===
=== BitAnd() ===


value = BitAnd(value)  
value = BitAnd(value)


Returns bitwise AND of the two values.  
Returns bitwise AND of the two values.


<br>


=== BitOr() ===
=== BitOr() ===


value = BitOr(value)  
value = BitOr(value)


Returns bitwise OR of the two values.  
Returns bitwise OR of the two values.


<br>


=== BitXOR() ===
=== BitXOR() ===


value = BitXOR(value)  
value = BitXOR(value)


Returns bitwise X-OR of the two values.
Returns bitwise X-OR of the two values.
=== pow() ===
value = pow(x,y)
Returns x to the power of y.
=== GetColorA() ===
value = GetColorA(color)
Returns Return Alpha component of AARRGGBB or palette index colour.
=== GetColorR() ===
value = GetColorR(color)
Returns Return Red component of AARRGGBB or palette index colour.
=== GetColorG() ===
value = GetColorG(color)
Returns Return Green component of AARRGGBB or palette index colour.
=== GetColorB() ===
value = GetColorB(color)
Returns Return Blue component of AARRGGBB or palette index colour.

Revision as of 13:31, 18 April 2017

This automatically generated page summarises the functions available in the expression language.used where data is needed. Planimate uses attribute references to specify this data. An attribute reference can include expressions containing one or more of the functions below.

When editing an expression, type Ctrl-F to get a list of functions. If the cursor is after a ".", you get a list of Property Functions.

This page was generated using Planimate 8.99.0.

sqrt()

value = sqrt(value)

Returns square root of 'value'.


sqr()

value = sqr(value)

Returns 'value' multiplied by itself.


ceil()

value = ceil(value)

Returns smallest integer greater or equal to 'value'.


floor()

value = floor(value)

Returns largest integer not greater than 'value'.


fabs()

value = fabs(value)

Returns removes negative sign if 'value' is negative.


round()

value = round(value)

Returns the nearest integer to 'value'.


trunc()

value = trunc(value)

Returns 'value' with the fraction trimmed off.


exp()

value = exp(value)

Returns mathematical 'e' to the power of 'value'.


ln()

value = ln(value)

Returns natural logarithm of 'value'.


log10()

value = log10(value)

Returns base 10 logarithm of 'value'.


pow10()

value = pow10(value)

Returns 10 to the power of 'value'.


pow2()

value = pow2(value)

Returns 2 to the power of 'value'.


cos()

value = cos(value)

Returns trigonometric cosine where 'value' is in radians.


sin()

value = sin(value)

Returns trigonometric sine where 'value' is in radians.


tan()

value = tan(value)

Returns trigonometric tangent where 'value' is in radians.


acos()

value = acos(value)

Returns inverse of cos() function.


asin()

value = asin(value)

Returns inverse of sin() function.


atan()

value = atan(value)

Returns inverse of tan() function. atan2 is more useful if you have an x,y point.


atan2()

value = atan2(x,y)

Returns angle in radians between x axis and (x,y) on cartesian graph.


hypot()

value = hypot(x,y)

Returns sqrt(x*x + y*y).


min()

value = min(val1,val2)

Returns minimum of 'val1' and 'val2'.


max()

value = max(val1,val2)

Returns maximum of 'val1' and 'val2'.


strlen()

integer-value = strlen(string)

Returns length of 'string'.


strleft()

string = strleft(string,count)

Returns leftmost 'count' characters from 'string'.


strmid()

string = strmid(string,pos,count)

Returns starting at 'pos' up to 'count' characters in 'string'.


strright()

string = strright(string,count)

Returns rightmost 'count' characters from 'string'.


strreverse()

string = strreverse(string)

Returns reversed order of characters in 'string'.


strupper()

string = strupper(string)

Returns 'string' converted to lowercase.


strlower()

string = strlower(string)

Returns 'string' converted to uppercase.


strcompare()

integer-value = strcompare(str1,str2[,casesensitive=0])

Returns 0 if 'str1' and 'str2' are the same, 1 if 'str1' has higher ascii-sort order, -1 if 'str1' has lower ascii-sort order. Default is to ignore case unless casesensitive is provided and is not zero.


strfind()

integer-value = strfind(str1,str2[,casesensitive=0])

Returns character where 'str2' first starts in 'str1' or 0 if not found.


strclean()

string = strclean(string)

Returns 'string' after leading spaces, trailing spaces, new lines and tabs have been removed. Any double quotes are made single.


strinsert()

string = strinsert(str1,str2,pos)

Returns 'str1 with str2 inserted before character at position 'pos'.


strdelete()

string = strdelete(string,pos,count)

Returns 'string' after deleteing 'count' characters starting at 'pos'.


strreplace()

string = strreplace(string,str1,str2[,casesensitive=0])

Returns 'string' after all occurances of 'str1' are replaced with 'str2'. Match is not casesensitive unless 'casesensitive' is non zero.


strchar()

integer-value = strchar(string,pos)

Returns ASCII code of character at 'pos' of 'string'.


strasc()

string = strasc(code)

Returns a single character string containing the given 8 bit ASCII character.


BitAnd()

value = BitAnd(value)

Returns bitwise AND of the two values.


BitOr()

value = BitOr(value)

Returns bitwise OR of the two values.


BitXOR()

value = BitXOR(value)

Returns bitwise X-OR of the two values.


pow()

value = pow(x,y)

Returns x to the power of y.


GetColorA()

value = GetColorA(color)

Returns Return Alpha component of AARRGGBB or palette index colour.


GetColorR()

value = GetColorR(color)

Returns Return Red component of AARRGGBB or palette index colour.


GetColorG()

value = GetColorG(color)

Returns Return Green component of AARRGGBB or palette index colour.


GetColorB()

value = GetColorB(color)

Returns Return Blue component of AARRGGBB or palette index colour.