I am writing a drawing program but I want to keep the scale down
(there could end up being several hundred objects on the screen).
I want to limit the points collected to a certain distance from other
points already collected, in other words, if you're drawing a line it
will only record points on the line every 6 pixels. How do I determine
how far away one point is from another? if they are restricted to
straight lines that's fine but as soon as they draw at an angle I'm
faced with determining how far away one point is from another in co
ordinate space.
Any help would be appreciated.
Tom P. 6 1666
On Mar 31, 1:24 pm, "Tom P." <padilla.he...@gmail.comwrote:
I am writing a drawing program but I want to keep the scale down
(there could end up being several hundred objects on the screen).
I want to limit the points collected to a certain distance from other
points already collected, in other words, if you're drawing a line it
will only record points on the line every 6 pixels. How do I determine
how far away one point is from another? if they are restricted to
straight lines that's fine but as soon as they draw at an angle I'm
faced with determining how far away one point is from another in co
ordinate space.
Any help would be appreciated.
Tom P.
Point x = new Point(1, 2);
Point y = new Point(3, 4);
double distance = Point.Distance(x, y);
I hope that helps.
goodluck,
tom
On Mar 31, 1:58 pm, thomasnguyencom <thomasnguyen...@gmail.comwrote:
On Mar 31, 1:24 pm, "Tom P." <padilla.he...@gmail.comwrote:
I am writing a drawing program but I want to keep the scale down
(there could end up being several hundred objects on the screen).
I want to limit the points collected to a certain distance from other
points already collected, in other words, if you're drawing a line it
will only record points on the line every 6 pixels. How do I determine
how far away one point is from another? if they are restricted to
straight lines that's fine but as soon as they draw at an angle I'm
faced with determining how far away one point is from another in co
ordinate space.
Any help would be appreciated.
Tom P.
Point x = new Point(1, 2);
Point y = new Point(3, 4);
double distance = Point.Distance(x, y);
I hope that helps.
goodluck,
tom
You're kidding? All the crap I went through and it's already a
framework method? I could choke myself.
Thank you very much. I'm sorry I didn't look harder.
Tom P.
On Mar 31, 2:58*pm, thomasnguyencom <thomasnguyen...@gmail.comwrote:
On Mar 31, 1:24 pm, "Tom P." <padilla.he...@gmail.comwrote:
I am writing a drawing program but I want to keep the scale down
(there could end up being several hundred objects on the screen).
I want to limit the points collected to a certain distance from other
points already collected, in other words, if you're drawing a line it
will only record points on the line every 6 pixels. How do I determine
how far away one point is from another? if they are restricted to
straight lines that's fine but as soon as they draw at an angle I'm
faced with determining how far away one point is from another in co
ordinate space.
Any help would be appreciated.
Tom P.
Point x = new Point(1, 2);
Point y = new Point(3, 4);
double distance = Point.Distance(x, y);
I hope that helps.
goodluck,
tom
If the distance cutoff is constant you're going to be executing this
many times or for many points you might want to do the math manually
and then compare against distance squared instead e.g. distance^2 =
(x2x1)^2 + (y2y1)^2
On Mar 31, 1:58 pm, thomasnguyencom <thomasnguyen...@gmail.comwrote:
On Mar 31, 1:24 pm, "Tom P." <padilla.he...@gmail.comwrote:
I am writing a drawing program but I want to keep the scale down
(there could end up being several hundred objects on the screen).
I want to limit the points collected to a certain distance from other
points already collected, in other words, if you're drawing a line it
will only record points on the line every 6 pixels. How do I determine
how far away one point is from another? if they are restricted to
straight lines that's fine but as soon as they draw at an angle I'm
faced with determining how far away one point is from another in co
ordinate space.
Any help would be appreciated.
Tom P.
Point x = new Point(1, 2);
Point y = new Point(3, 4);
double distance = Point.Distance(x, y);
I hope that helps.
goodluck,
tom
On second thought... no it doesn't help.
I'm not finding that static method. Am I missing a namespace or
something?
Tom P.
On Mar 31, 2:15 pm, Israel <israeldip...@hotmail.comwrote:
On Mar 31, 2:58 pm, thomasnguyencom <thomasnguyen...@gmail.comwrote:
On Mar 31, 1:24 pm, "Tom P." <padilla.he...@gmail.comwrote:
I am writing a drawing program but I want to keep the scale down
(there could end up being several hundred objects on the screen).
I want to limit the points collected to a certain distance from other
points already collected, in other words, if you're drawing a line it
will only record points on the line every 6 pixels. How do I determine
how far away one point is from another? if they are restricted to
straight lines that's fine but as soon as they draw at an angle I'm
faced with determining how far away one point is from another in co
ordinate space.
Any help would be appreciated.
Tom P.
Point x = new Point(1, 2);
Point y = new Point(3, 4);
double distance = Point.Distance(x, y);
I hope that helps.
goodluck,
tom
If the distance cutoff is constant you're going to be executing this
many times or for many points you might want to do the math manually
and then compare against distance squared instead e.g. distance^2 =
(x2x1)^2 + (y2y1)^2
This is what I'm going to be using. I'll just do the math myself. I
never did find the method referred to, I don't know where tom got it
but he's got me beat.
Thanks for the help guys.
Tom P.
"Tom P." <pa***********@gmail.comwrote in message
news:bc**********************************@s13g2000 prd.googlegroups.com...
On Mar 31, 1:58 pm, thomasnguyencom <thomasnguyen...@gmail.comwrote:
>On Mar 31, 1:24 pm, "Tom P." <padilla.he...@gmail.comwrote:
I am writing a drawing program but I want to keep the scale down
(there could end up being several hundred objects on the screen).
I want to limit the points collected to a certain distance from other
points already collected, in other words, if you're drawing a line it
will only record points on the line every 6 pixels. How do I determine
how far away one point is from another? if they are restricted to
straight lines that's fine but as soon as they draw at an angle I'm
faced with determining how far away one point is from another in co
ordinate space.
Any help would be appreciated.
Tom P.
Point x = new Point(1, 2); Point y = new Point(3, 4); double distance = Point.Distance(x, y);
I hope that helps.
goodluck, tom
On second thought... no it doesn't help.
I'm not finding that static method. Am I missing a namespace or
something?
Tom P.
Distance between (x1,y1) and (x2,y2)
= sqrt((x1x2)*(x1x2) + (y1y2)*(y1y2))
(Pythagoras's theorem). This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: some one 
last post by:
Does anyone know the algorithm or a function out there that will
compute the offset location given the following:
inputs:
1) x,y coordinate of starting point
2) angle (bearing)
3) distance to...

by: michael.mcgarry 
last post by:
Hi,
I have a question about floating point precision in C.
What is the minimum distinguishable difference between 2 floating point
numbers? Does this differ for various computers?
Is this...

by: Skybuck Flying 
last post by:
Hi,
I needed a method to determine if a point was on a line segment in 2D. So I
googled for some help and so far I have evaluated two methods.
The first method was only a formula, the second...

by: garyusenet 
last post by:
I'm trying to investigate the maximum size of different variable types.
I'm using INT as my starting variable for exploration. I know that the
maximum number that the int variable can take is:...

by: softwaredoug 
last post by:
I can't see to easily find this on google or in a newsgroup
Is there a standard function/macro/whatever you can call and determine
the distance in a C program how deep one is in the C call stack...

by: DanielJohnson 
last post by:
I wrote a simply program with a 3 D coordinate called point. I am
adding two points, taking their distance etc. gcc compiler is not
identifying the struct. Here is the code. I get bunch of errors....

by: nw 
last post by:
Hi,
I'd like to compare 2 floating point numbers within a given error. I'd
rather not use a absolute error but one related to the number of
values that can be represented between the two floats....

by: pjmulla 
last post by:
I am nes to python and need some help. Can anyone lead me in the
right direction to create and print a Point object, and then use id to
print the object's unique identifier. Translate the...

by: illusion.admins 
last post by:
I am trying to code something to tell me if a selected point is in a
particular ellipse. For the ellipse I know how it was constructed
(know the x,y, and width, height). But if I just check to see...

by: ryjfgjl 
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...

by: BarryA 
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

by: Sonnysonu 
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by columnwise with in the specific length.
suppose the i have to...

by: marktang 
last post by:
ONU (Optical Network Unit) is one of the key components for providing highspeed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

by: Hystou 
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

by: Oralloy 
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bitfields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...

by: jinu1996 
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

by: Hystou 
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

by: tracyyun 
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, ZWave, WiFi, Bluetooth, etc. Each...
 