cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - You can change your system assigned username to something more personal in your community settings. X

10-Marble

## integer value error

Can I know why this function is not working

1 ACCEPTED SOLUTION

Accepted Solutions
18-Opal
(To:Cornel)

And I do not know why there are that many elements in the calculation, as we have only 10 elements in X' and Y'

11 REPLIES 11
20-Turquoise
(To:YA_10963798)

Your jx and jy are range. So you must select one of it by [0 or ^row(0).

However, Prime 10 shows bugs for these methods.

10-Marble
(To:ttokoro)

I'm not sure if I understand what you are trying to say , Can you show me in the attached sheet

I want to apply the atan function to all x and y values

18-Opal
(To:ttokoro)

ttkoro the problem is here:

18-Opal
(To:Cornel)

Something like this, but as it is right now it is not taking into account the last element:

But anyway, as there in X' vector there are 2 consecutive elements for which that difference is 0, the obivious error divided by zero will be thrown.

18-Opal
(To:Cornel)

But if we change a little bit X' vector (these elements with yellow), in order at least the calculation to be possible for X':

Of course, the last element is not taken into account here. Maybe others can figure out how could be done in order to include also the last element in calculation (7.395 9.225)

18-Opal
(To:Cornel)

And I do not know why there are that many elements in the calculation, as we have only 10 elements in X' and Y'

10-Marble
(To:Cornel)

Thank you for your help I appreciate it

My answer is not yet fully. I said this already, the last element is not taken into account, and I have a doubt why there are so many elements calculated:
This difference is not calculated:

And there are many elements in below calculation, and I do not know if this is ok or not, as you have only 10 elemets in X' and Y'

20-Turquoise
(To:Cornel)

Index of Y and X is not integer number but using Range to Vector undocumented technique. But Prime 10 delete the undocumented technique.

So, we must make vector to use [i element operator. 80 means using undocumented technique for untill Prime 9.

24-Ruby V
(To:Cornel)

@Cornel wrote:

And I do not know why there are that many elements in the calculation, as we have only 10 elements in X' and Y'

That's because you are using two separate range variables to index X' and Y'. Each range runs from 0 to 8 and so you get a data structure with 9*9=81 entries because each X' difference is combined by each Y' difference.

This structure isn't a range and it isn't a vector. Actually its an invalid object. You can see that when you try to assign it a variable - it will fail.

BTW, the division by zero can be avoided by using the atan2 function so you get the 90 degree instead of an error 😉

The additional benefit of using atan2 is that we correct values for the full range from -180° to +180°

Here an attempt

Prime 9 sheet attached

24-Ruby II
(To:YA_10963798)

Martin Hanák
Announcements
Top Tags