MVP 2023 Flex727 Posted May 9, 2018 MVP 2023 Report Posted May 9, 2018 I would create a lookup table in a Data Table.
MVP 2023 Joe Tauser Posted May 9, 2018 MVP 2023 Report Posted May 9, 2018 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
viscoelastic Posted May 9, 2018 Author Report Posted May 9, 2018 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?
MVP 2023 Flex727 Posted May 9, 2018 MVP 2023 Report Posted May 9, 2018 After looking at Joe's answer, I now would DEFINITELY use a lookup table.
MVP 2023 Joe Tauser Posted May 10, 2018 MVP 2023 Report Posted May 10, 2018 Yes, it will be radians. 1 radian = 57.2958 degrees. 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.
Saragani Posted May 10, 2018 Report Posted May 10, 2018 You are talking about doing a SIN-1 in VisiLogic, right? Doesn't VisiLogic have ASin under the Ladder Float -> Trig functions? 1
MVP 2023 Joe Tauser Posted May 11, 2018 MVP 2023 Report Posted May 11, 2018 Duh. Yes. Yes it does. Joe T.
viscoelastic Posted May 11, 2018 Author Report Posted May 11, 2018 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now