|
-
Jul 18th, 2001, 05:01 AM
#1
Thread Starter
Addicted Member
Click on a line (Linear function)
I actually found one possible solution, however it doesn't work.
Let's see:
For each line there's a mathematical function with that form:
y = k * x + n
y= y coord; x = x coord; n = number; k = static variable
Following function is the same as above, it just uses 2 coordinates (x, x1, y, y1)
y - y1 = k * (x - x1) ---> y = k * (x - x1) + y1
Point is that here we do not have k, so we have to calculate it. This is done by next function:
k = (y2 - y1) / (x2 - x1)
Now we have k, both coordinates and function for that line. And even now I cannot find out if I clicked on a line.
Any suggestions?
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|