How to use math functions

created 11/12/2004; updated 20/11/2005

Ultimate Robolab (> v. 1.4.5.2) has a built-in floating-point mathematical kernel. The following example demonstrates a program to display the tan-function of angles from 360 down to 0. The RCX reacts with a buzz and the message "err 1", when trying to compute the tan(90°) or tan(270°). In the case of an error, the function returns zero !

Note that the RCX is initialized this time, which means that some important kernel-functions are running (for example the RUN-button is working), and only the sound is activated as automatic background-function. Also pay attention that the user MUST add the math-icon BEFORE calling one of the functions. Note that the sine, cosine and the tan-functions use the same RCX subroutine. By default all the functions are selected:


NEW NEW NEW

Since version 1.4.5.6 (dec 2004) Ultimate ROBOLAB also disposes of the y=2x and y=log2x functions. What makes the implementation interesting is the new algorithm.

html-version

pdf-version


RetourMain Page