Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#26 Re: Help Me ! » 8 numbers of angle direction » 2014-12-03 21:03:39

Hi once again,

This time i have confusion.
we got direction in 8 numbers. Well if we consider the below example

direc_Code_exma.jpg

but at first codes do not exactly similar to the codes in circle
i wanna codes like this ...

0 ~ 1 ---> reoresent to 0
1 ~ 2 --> represent to 1
2 ~ 3 --> represent to 2
3 ~ 4 ---> represent to 3
4 to 5 ---> represent to 4
5 to 6 ---> represent 5
6 to 7 reoresent code 4
7 ~ 0 represent code 7.

The coordinate of that image are as follows
@ 0: [251, 141]
@ 1: [286, 78]
@ 2: [367, 92]
@ 3: [402, 146]
@ 4: [372, 234]
@ 5: [309, 258]
@ 6: [248, 242]
@ 7: [232, 205]
@ 8: [258, 129]

Direction Numbers are :
1 0 7 6 4 4 3 2

#27 Re: Help Me ! » 8 numbers of angle direction » 2014-12-03 16:59:14

Why at angle -37.7468, you got direction code 1, and i get 0.

Is that some logical reason orwhat.
I do not get it .




pari_alf wrote:

hi phrontister,

Thanks for the reply.
If you see my reply #4 and #6, i used the same formula that you used.
that formula gave me same direction codes

Direction Codes
4 6 7 0 0 1 2 3

where 0 should be 1 and last code should be 4, compare to your result.

I used exactly this formula in c++

correct_directCoode =   abs(int( angle/45  + 0.5) - 8 ) % 8

Is there some logical reason for being not correct?

Note: my angles and direction codes are same like yours

phrontister wrote:

Hi pari_alf,

I adapted the compass in post #46 of the other thread to suit 8 sectors:

http://k003.kiwi6.com/hotlink/5t2vndi0jw/Angle_directions_compass_example.png

A line's direction code is easily found by checking the compass to ascertain which 45° sector the line's angle falls into. eg, the direction code for the red line with angle -131.0995° would be 3, as it lies between -112.5° and -157.5°.

The following Excel chart shows this too:

http://k003.kiwi6.com/hotlink/pgz46equ1i/Direction_codes-Excel.png

Bob's formula for the direction code of the -131.0995° angle is =MOD(ABS(INT(G9/45+0.5)-8),8), where G9 = -131.0995. Answer = 3.

Your direction code for that angle is 2, which I think is incorrect.

If you agree with what I've done, then I think that the only unanswered question would be about which code should be given to a line that falls exactly on a sector boundary.

#28 Re: Help Me ! » 8 numbers of angle direction » 2014-12-03 15:11:36

hi phrontister,

Thanks for the reply.
If you see my reply #4 and #6, i used the same formula that you used.
that formula gave me same direction codes

Direction Codes
4 6 7 0 0 1 2 3

where 0 should be 1 and last code should be 4, compare to your result.

I used exactly this formula in c++

correct_directCoode =   abs(int( angle/45  + 0.5) - 8 ) % 8

Is there some logical reason for being not correct?

Note: my angles and direction codes are same like yours

phrontister wrote:

Hi pari_alf,

I adapted the compass in post #46 of the other thread to suit 8 sectors:

http://k003.kiwi6.com/hotlink/5t2vndi0jw/Angle_directions_compass_example.png

A line's direction code is easily found by checking the compass to ascertain which 45° sector the line's angle falls into. eg, the direction code for the red line with angle -131.0995° would be 3, as it lies between -112.5° and -157.5°.

The following Excel chart shows this too:

http://k003.kiwi6.com/hotlink/pgz46equ1i/Direction_codes-Excel.png

Bob's formula for the direction code of the -131.0995° angle is =MOD(ABS(INT(G9/45+0.5)-8),8), where G9 = -131.0995. Answer = 3.

Your direction code for that angle is 2, which I think is incorrect.

If you agree with what I've done, then I think that the only unanswered question would be about which code should be given to a line that falls exactly on a sector boundary.

#29 Re: Help Me ! » 8 numbers of angle direction » 2014-12-03 02:17:12

you are exactly Right @phrontister
Thank you for explaing well. smile

Yes this time,,i am interested in assigning 8 numbers to each direction based on its angle.
Previously, i had come cross with 16 direction code. but now i need to work on 8 direction code. I had already calculated and mention in my reply #6 and method of this is given in reply #5 .

but i am not satisfy with my calculated 8 direction codes.



phrontister wrote:

Hi Bob,

Please also say where you want the angles to be measured from, in what direction.

From this post of mine on the thread that pari_alf referred to above:

...a line's angle (ie, the angle measured from (a) the horizontal axis of a line's starting point to (b) the next point...)

The below Geogebra image shows those horizontal axes, and the green angle images identify what is measured.

Also, as per pari_alf's drawing, the circular direction of this shape is anti-clockwise, starting from the green point and ending with the red.

All my angles agree with pari_alf's, the difference being that for upward-pointing lines mine show as positive instead of negative.

Because of the difference between Geogebra and pari_alf's method/software, my y coordinates are negative in order to obtain the same shape, which is drawn in the fourth (south-eastern) quadrant (as pari_alf's is...see post #10 above).

http://k003.kiwi6.com/hotlink/yr6iz4ugar/Angle_directions.png

Here is an Excel chart of ATan2 calcs...which angles agree with the above.

http://k003.kiwi6.com/hotlink/knuosgxxzd/Angle_directions-Excel.png

#30 Re: Help Me ! » 8 numbers of angle direction » 2014-12-02 20:27:28

Well..  if you see the figure.. Figure already show the start point in green color and end point in the red color. So i think, it is easy to say where would be direction.

these are the points

@ 0 : [260,308]
@ 1 : [209,324]
@ 2 : [201,375]
@ 3 : [242,438]
@ 4 : [275,445]
@ 5 : [337,397]
@ 6 : [343,365]
@ 7 : [302,318]
@ 8 : [235,312]

point at index 0 and 8 are the start and end point.
so i think it is easy to say .. where would be the direction of angle.

#31 Re: Help Me ! » 8 numbers of angle direction » 2014-12-02 19:58:54

anyone can help me to get the 8 numbers of directions based on its angle?

#32 Re: Help Me ! » 8 numbers of angle direction » 2014-12-02 17:19:53

bob bundy wrote:

I will;  but you have not said what yours is.  dizzy

Bob

Can you reply me quickly.. i need to fix the problems..

#33 Re: Help Me ! » 8 numbers of angle direction » 2014-12-02 14:33:16

I think my coordinates are window screen coordinates like shown below

screen_window_coordinates.jpg

#34 Re: Help Me ! » 8 numbers of angle direction » 2014-12-02 02:12:34

I think you please change it so that you will get same like mine.
Than we can go further easily .. smile

#35 Re: Help Me ! » 8 numbers of angle direction » 2014-12-01 22:36:28

The image is attached again in the below fig

8_direct_result.jpg

The x,y coordinates are as follows

@ 0 : [260,308]
@ 1 : [209,324]
@ 2 : [201,375]
@ 3 : [242,438]
@ 4 : [275,445]
@ 5 : [337,397]
@ 6 : [343,365]
@ 7 : [302,318]
@ 8 : [235,312]

... the following are the dx, dy and its angle in radian and degree//
dx , dy : -51 16

angle in radian : 2.83759

angle in degree : 162.582

dx , dy : -8 51

angle in radian : 1.72639

angle in degree : 98.9149

dx , dy : 41 63

angle in radian : 0.993863

angle in degree : 56.9442

dx , dy : 33 7

angle in radian : 0.209023

angle in degree : 11.9761

dx , dy : 62 -48

angle in radian : -0.658806

angle in degree : -37.7468

dx , dy : 6 -32

angle in radian : -1.38545

angle in degree : -79.3803

dx , dy : -41 -47

angle in radian : -2.28812

angle in degree : -131.1

dx , dy : -67 -6

angle in radian : -3.05228

angle in degree : -174.883

Next , below are the direction codes
Calculated direction Codes
4 6 7 0 0 1 2 3

#36 Re: Help Me ! » 8 numbers of angle direction » 2014-12-01 20:49:04

Let me consider a good example of shape round.

the x,y points of the round shape is given below.
@ 0: [260, 308]
@ 1: [209, 324]
@ 2: [201, 375]
@ 3: [242, 438]
@ 4: [275, 445]
@ 5: [337, 397]
@ 6: [343, 365]
@ 7: [302, 318]
@ 8: [235, 312]

and these points are graphysically shown below.
simplifiy_Line1.jpg

Now.. In order to assign the 8 numbers to each line segment based on its angle..
i performed the following steps

1. compute angle
2. angle divide by 45 and add 0.5
3. take the integer part
4. subtract from 8
5. use mod 8, to get the number in range.

This method is actually someone answered me on my post of assigning 16 numbers to segments .

But since i now working on 8 numbers of direction of each segment based on angle . so instead of 16, i am using 8..

Ok.. the result i got is as follows...

features_DC0.jpg

Is it correct? I think my 8 number to direction of each segment is not correct.

need suggestion.. and correction.. thanks

#37 Re: Help Me ! » 8 numbers of angle direction » 2014-12-01 17:52:13

bobbym wrote:

This is what those points look like when graphed. What is supposed to happen now?

http://i.imgur.com/avA1O7r.png

Well, what i wanna is .. assign the 8 direction codes to each angle of line segment.

the 8 direction code is given below.
8_direction_code.jpg

#38 Help Me ! » 8 numbers of angle direction » 2014-12-01 15:04:42

pari_alf
Replies: 29

i have these points.. x,y coordinates

250 466
257 464
250 466
256 453
270 408
295 347
370 270
463 266
465 297
464 282
455 287
450 289
447 294

I wanna represent each angle of point in 8 numbers
Previously i tried to work with 16 numbers of directions but this time .. i wanna give try with 8 numbers of angle direction..
Could any one help me how can i do it,
thanks

#39 Re: Help Me ! » least angle method » 2014-12-01 14:55:09

bobbym wrote:

What are you trying to do?

I have set of points which represent a shape of triangle. i wanna minimize points which best maintain the shape. In other to do that, i found one method in paper called, least angle method. I tried to google it but i could not find any useful that could help me to understand it.
I found only least angle regression which i am not sure its same or not.
Anyone could help me to lead it. thanks

#40 Help Me ! » least angle method » 2014-11-30 13:27:10

pari_alf
Replies: 2

Does any one have idea for least angle method? ,
This method is used to extract the feature points of set of polylines.

I tried to google it but could not find anything useful which could help me to understand that how to extract points.

Anypne can pls help me.
thanks

#41 Help Me ! » minimum value at specific index is important » 2014-11-23 19:09:19

pari_alf
Replies: 2

Hi everyone!

I am back with new problems.
I have a set of points..

A = { 1 , 5 , 3 , 9 , 1 ,7 , 1 }

Now in the set.. the minmum value is 1 which is at index 0,  4 and 6.

if we find the minimum value from i = 0 to 6 values.. the minimum value 1 at index 0 will be the output. but i need the minimum value at index 4.

In that case, how can get the minimum value at specific index..
For example minimum value  1 at index 4 is important for me.

In that case, what to do?

Kindly help me .
Thanks
Regards,
Pari

#42 Help Me ! » how to decide the optimal path? » 2014-08-26 18:28:00

pari_alf
Replies: 2

Here is a question to know that how to decide the optimal path?

For example, i have three paths A , B , C.
The penalty of A = 14, B= 3 and C=3. How can we say which path is Optimal way?

Kindly help me to find the Optimal Path..

Thanks

#43 Re: Help Me ! » angle between points of a line » 2014-06-05 14:43:02

Hi ,

Hope you are good.
This time i tested 8 direction codes on above given points

My direction code result is shown in the below image.
pts_8_Directcode.png

The points are
105 66
114 92
104 11
99 131
71 144
37 168

And the 8 direction codes are as follows
2
7
6
6

My method of calculating the direction code is same like you directed me for 16 direction  codes.

I used the following steps for calculating the direction Codes

1. take angle
2. divide by 40
3. add 0.5 to round up or down correctly
4. take the integer part
5. subtract from 8 to get the correct rotational direction
6. use mod 8 division to get the numbers in range.

The 8 direction code image is shown below
8_direcxtion_Code.gif

In the image, numbers are assigned to each direction.

=-----------------------------
But my direction  codes seems not correct.




bob bundy wrote:

hi pari_alf

So you wish to convert those angles into numbers from 0 to 15 according to the diagram below.

Step 1.  Take the calculated angles

result
70 .9...
-97.0....
92.3....
155.0...
144.7....

step 2.  Divide each by 22.5

result
3.15..
-4.31..
4.10..
6.89..
6.43..

step 3.  Add 0.5 so that when I use INT I will round up or down correctly

result
3.65..
-3.81..
4.60..
7.39..
6.93..

step 4.    take the integer part of (note that the negative goes to -4 with my software)

result
3
-4
4
7
6

step5.  Subtract from 16 to get the correct rotational direction

result
13
20
12
9
10

step6.  use mod 16 division to get the numbers in range

result
13
4
12
9
10

And there you have it.  I suggest you check boundary cases such as angle = 90 in case these misbehave.

Bob

#44 Re: Help Me ! » angle between points of a line » 2014-05-22 14:03:14

Hi bob,

Yes sorry, i could not give time to it.
Hope you understand.

I will reply to all questions one by one.
Hope it would be ok.

Thanks smile

bob bundy wrote:

hi pari_alf

We have now reached post 53.  Your last post was number 45 on April 11th.  Since then phrontister has done a lot of work for you which you haven't acknowledged. 

On 9th May phrontister asked you several questions about the way you want this to work.  You haven't answered him.

The people who give up time to help others on the forum, do not get paid for it.  They just do it because they want to be helpful.  But it is very hard and discouraging, if the person wanting help doesn't even say whether the help has been understood and appreciated.

Please look back at the last 8 posts and say whether it has made sense.  Then answer the questions you have been asked.

Thanks,

Bob

#45 Re: Help Me ! » angle between points of a line » 2014-05-22 13:51:01

bob bundy wrote:

hi pari_alf

I still am unable to answer that without knowing how you computed the angles.

Are you using a calculator? In which case, which one?

Or some software? In which case what software?

How have you determined dy and dx?  Please post the actual calculation you did.

smile

Bob

Hi Bob, sorry i did not notice about the questions.
I think i mentioned before that i am computing angle using atan2 (dy / dx)

And i computed dy, dx as follows dx = abs (p2.x - p1.x) , dy = abs (p2.y - p1.y);

I did programming in c++.

#46 Re: Help Me ! » angle between points of a line » 2014-04-10 18:20:44

Hi Bob,

hmm frankly speaking, those direction Codes are not matched with the direction of lines of the points of character drawn on the image. So i am still not satisfied.
Yes i used the same steps that you gave in post 31.

#47 Re: Help Me ! » angle between points of a line » 2014-04-08 14:46:01

I have this image

img.png

I have these points of the above drawn character

x: 126, y: 279
x: 172, y: 257
x: 209, y: 238
x: 247, y: 230
x: 271, y: 225
x: 249, y: 334
x: 228, y: 369
x: 193, y: 383
x: 122, y: 411
x: 64, y: 439
x: 79, y: 451
x: 128, y: 449
x: 191, y: 416
x: 240, y: 376
x: 264, y: 358
x: 279, y: 343
x: 86, y: 270
x: 110, y: 256
x: 133, y: 246
x: 169, y: 248
x: 199, y: 250
x: 197, y: 273
x: 193, y: 304
x: 182, y: 334
x: 161, y: 366
x: 146, y: 397
x: 143, y: 419
x: 146, y: 434
x: 160, y: 443
x: 185, y: 420
x: 219, y: 390
x: 247, y: 366
x: 289, y: 343
x: 327, y: 340

-----------
and these are the angles computed by atan2 in degree form

@ 0 , Angle: -25.56
@ 1 , Angle: -27.1811
@ 2 , Angle: -11.8887
@ 3 , Angle: -11.7683
@ 4 , Angle: 101.411
@ 5 , Angle: 120.964
@ 6 , Angle: 158.199
@ 7 , Angle: 158.477
@ 8 , Angle: 154.231
@ 9 , Angle: 38.6598
@ 10 , Angle: -2.33731
@ 11 , Angle: -27.646
@ 12 , Angle: -39.2257
@ 13 , Angle: -36.8699
@ 14 , Angle: -45
@ 15 , Angle: -159.281
@ 16 , Angle: -30.2564
@ 17 , Angle: -23.4986
@ 18 , Angle: 3.17983
@ 19 , Angle: 3.81407
@ 20 , Angle: 94.9697
@ 21 , Angle: 97.3524
@ 22 , Angle: 110.136
@ 23 , Angle: 123.275
@ 24 , Angle: 115.821
@ 25 , Angle: 97.7652
@ 26 , Angle: 78.6901
@ 27 , Angle: 32.7352
@ 28 , Angle: -42.6141
@ 29 , Angle: -41.4237
@ 30 , Angle: -40.6013
@ 31 , Angle: -28.706
@ 32 , Angle: -4.51399

---------------

and these are the direction codes.

@ 0 : 1
@ 1 : 1
@ 2 : 1
@ 3 : 1
@ 4 : 12
@ 5 : 12
@ 6 : 10
@ 7 : 10
@ 8 : 10
@ 9 : 15
@ 10 : 0
@ 11 : 1
@ 12 : 2
@ 13 : 2
@ 14 : 2
@ 15 : 7
@ 16 : 1
@ 17 : 1
@ 18 : 0
@ 19 : 0
@ 20 : 13
@ 21 : 13
@ 22 : 12
@ 23 : 12
@ 24 : 12
@ 25 : 13
@ 26 : 14
@ 27 : 0
@ 28 : 2
@ 29 : 2
@ 30 : 2
@ 31 : 1
@ 32 : 0

----------------

I am not satisfy with my direction numbers to each angle.

Anyone help me to check it. thanks

#48 Help Me ! » need help to write algorithm in mathematical expression » 2014-03-12 19:36:45

pari_alf
Replies: 1

Hi guys,

1. I have list of regions in a vector form. I want to present in equation. Anyone   can help me in expression?

R = {1,2,3,....N}, where N is the total number of the regions


2. I matched some points with the regions. I want to show that in mathematical expression. Any method?, need idea..

thanks

#49 Help Me ! » How can we delete the posted question » 2014-03-10 20:22:30

pari_alf
Replies: 2

Hi guys.

If i post any question and than i want to delete that post.
Than how can i do it?
I want to delete my post.

Please guide me in this regards

Thanks

#50 Help Me ! » standard deviation formula » 2014-03-09 15:03:50

pari_alf
Replies: 1

Hi guys,

I found a standard deviation formula from a paper.
The formula is shown as below,

std_deviate.png

I want you to please explain me formula a little in word.

Thanks

Board footer

Powered by FluxBB