How do i plot a point in a slanting line
-
Hi guys, I have a scenirio where by i need create some circles with varying distance in the sides of a triangle on a Web Page where all the sides are equal. I have the points for all the three vertex. I know just because i am using C# for that this question does't belong here. But please let me know if you have any idea on this.. Thank you
Thanks Laddie Kindly rate if the answer was helpful
-
Hi guys, I have a scenirio where by i need create some circles with varying distance in the sides of a triangle on a Web Page where all the sides are equal. I have the points for all the three vertex. I know just because i am using C# for that this question does't belong here. But please let me know if you have any idea on this.. Thank you
Thanks Laddie Kindly rate if the answer was helpful
You work out the ratio of width to height and use that to calculate the x for a given y, or vice versa.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
You work out the ratio of width to height and use that to calculate the x for a given y, or vice versa.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hi Christian, Thank you for the reply. But it will work only if the line is straight. You mean to say new x = (Width - n) Right.. But here it is a slanting line. Like the sides of a triangle. Or may be i got you wrong ? Thank you Laddiw
Thanks Laddie Kindly rate if the answer was helpful
-
Hi Christian, Thank you for the reply. But it will work only if the line is straight. You mean to say new x = (Width - n) Right.. But here it is a slanting line. Like the sides of a triangle. Or may be i got you wrong ? Thank you Laddiw
Thanks Laddie Kindly rate if the answer was helpful
You got me wrong. If x1=5, y1 = 10, x2 = 25, y2 = 50 then the ration is (25-5)/(50-10), or 20/40 or 1/2. So, if you want to know the y position when x is 10, you subtract 5, to get to your base line. Then you multiply 5 by 2. Then you add 10 ( your starting y ). So, 10,20 is a point on the line.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
You got me wrong. If x1=5, y1 = 10, x2 = 25, y2 = 50 then the ration is (25-5)/(50-10), or 20/40 or 1/2. So, if you want to know the y position when x is 10, you subtract 5, to get to your base line. Then you multiply 5 by 2. Then you add 10 ( your starting y ). So, 10,20 is a point on the line.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
You got me wrong. If x1=5, y1 = 10, x2 = 25, y2 = 50 then the ration is (25-5)/(50-10), or 20/40 or 1/2. So, if you want to know the y position when x is 10, you subtract 5, to get to your base line. Then you multiply 5 by 2. Then you add 10 ( your starting y ). So, 10,20 is a point on the line.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hi chris, I created a function something like this public void pointX(int x1, int y1, int x2, int y2, int dis,out float newX,out float newY) { float ygrad = y2 - y1; float xgrad = x2 - x1; ygrad /= 100; xgrad /= 100; newY = (dis * ygrad) + y1; newX = (dis * xgrad) + x1; } It is working fine... The requirement was that i need to draw some circles depending on some percentage, whose center will be an offset from the side of a triangle, where offset is the percentage. Any way thank you for that idea.. Have a nice day.
Thanks Laddie Kindly rate if the answer was helpful