Brian Dunning's FileMaker Custom Functions

cosSeries ( angleInRadians ; series ; k )

cosSeries returns the cosine of an angle as precise as you want, without the limitations of the built-in cosine function.

  Average rating: 4.2 (32 votes) Log in to vote

Jeremy Bante   Jeremy Bante
OshVay Systems, Inc.
http://www.oshvay.com/

Share on Facebook Share on Twitter

  Sample input:
SetPrecision(
cosSeries( 1; 0; 0);
250
)
  Sample output:
.5403023058681397174009366074429766037323104206179222276700972553811003947744717645179518560871830893435717311600300890978606337600216634564065122654173185847179711644744794942331179245513932543359435177567028925963757361543275496417544917751151312227

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

With FileMaker 7 came the capacity for storing numbers with 400 decimal digits of precision. However, FileMaker's built-in trigonometric functions still only evaluate to 16 places; cosSeries returns the cosine of an angle [in radians] as precise as you want (with use of the SetPrecision function) by recursively adding the terms of a power series. The last two arguments to the cosSeries function are for the function's own use in recursive calls, and each should always be 0 when called by the developer.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:

Under construction. Email me your wish list for improvements.