# anti sin math function.

## Recommended Posts

Is there a way I can do aSIN-1

##### Share on other sites

• MVP 2023

I would create a lookup table in a Data Table.

##### Share on other sites

• MVP 2023

Use the floating point math to implement a Taylor series-

I'd run the equation a few times in a spreadsheet to see how far n has to increment to get the accuracy you're looking for.

Joe T.

• 1
##### Share on other sites

10 minutes ago, Joe Tauser said:

Use the floating point math to implement a Taylor series-

I'd run the equation a few times in a spreadsheet to see how far n has to increment to get the accuracy you're looking for.

Joe T.

Thanks Joe. That will return radians? I can use the degrees function to go back?

##### Share on other sites

• MVP 2023

After looking at Joe's answer, I now would DEFINITELY use a lookup table.

##### Share on other sites

• MVP 2023

It's actually not as hard as it looks.  Many moons ago, I needed to calculate the cosine of an angle in a Siemens S7-200, which does not have floating point.  Some obscure neuron fired in my brain and remembered studying Taylor series in school as the way to determine the values of trigonometric functions.

Here's how to get cosine:

I used double integers (MLs or VD32 in SiemensSpeak) with a virtual decimal place of 4 and only had to take it out to k=4 to get a good value.  As you can see, if you go past that the numbers get really tiny and don't affect the value much.

If you expand the arcsin Tayor series out to n=4 the front part of the equation becomes just number that some nimble fingering on your calculator can arrive at and you can punch that in as a constant to multiply the x^(2n+1) amount by.

It's no fun being an engineer if you don't stretch your brain sometimes.

Joe T.

##### Share on other sites

You are talking about doing a SIN-1﻿  in VisiLogic, right?

Doesn't VisiLogic have ASin under the Ladder Float -> Trig functions?

• 1
##### Share on other sites

• MVP 2023

Duh.

Yes.  Yes it does.

Joe T.

##### Share on other sites

I over complicated this entire thing. So for anyone else trying to get degrees from the hypotenuse and the opposite side this is how I did it. The first subtraction block was done to bring my vertex to 0

## Create an account

Register a new account

×