473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

MFC. How to find End point of a line?

Hello,

For Drawing a angled line using the MFC function pDC->AngleArc(cStart.x,cStart.y,AngLineLength,Angle, 0) but for storing the line I want to know the end point of the line. how can I find it?

Thanks
John
Feb 3 '09 #1
5 6258
JosAH
11,448 Expert 8TB
@mvjohn100
The line is the hypothenuse of a triangle with length AngLineLength; the length of x is cos(Angle)*AngleLineLength and the length of y is sin(Angle)*AngleLineLength; add the values of cStart.x and cStart.y to this vector (line lengths) to find the end coordinates.

kind regards,

Jos
Feb 3 '09 #2
Thanks Jos for your Answer

John
Feb 4 '09 #3
For a line segment one endpoint is (-8, 10) and the midpoint of (- 2, 6). Find the coordinates of the other endpoint (x1, y1).

To Solve for X1 To Solve for y1

The coordinates for the other endpoint are (4, 2).

htp://argyll.epsb.ca/lburns/coordinate_geometry_6.2.html
Feb 5 '09 #4
donbock
2,426 Expert 2GB
Can you request the current cursor position from the graphics library. That way you don't have to worry about rounding discrepancies.

Would GetCursorInfo() do the job for you?
Feb 5 '09 #5
Thanks for the answers. I solved the issue by the MFC function GetCurrentPosition()
Feb 6 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Smith | last post by:
The program compiled successfully, but it gives the following error on runtime.... java.lang.NullPointerException at FrogManiaApp.paint(FrogManiaApp.java:102) at...
1
by: Saeed Amrollahi | last post by:
Dear All C++ Programmers Hello I am Saeed Amrollahi. I am a software engineer in Tehran Sewerage Company. I try to use std::map and map::find member function. I use Visual Studio .NET. my...
6
by: MLH | last post by:
SELECT Adresses.RawData FROM Adresses WHERE (((Adresses.RawData)=InStr(1,,Chr$(13)))); Its not doing the trick for me and I'm not sure why.
65
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...
6
by: Robert Lawson | last post by:
I continue to get the below error message when trying to load a aspx file. Could someone please point me in the right direction for solving this? I'm trying to access an access data base and I'm...
0
by: Rob Dob | last post by:
Hi, I have a VS2003 C# asp.net project that has been converted into a VS2005 project. Everything seemed to work well until I make a modification to anything within the Component Designer...
6
by: Mudcat | last post by:
Hi, I can't figure out why ctypes won't load the DLL I need to use. I've tried everything I can find (and the ctypes website is down at the moment). Here's what I've seen so far. I've added...
1
by: marcnz | last post by:
I have been charged of creating a coldfusion web site for our company. Our database has a ms sql 2005 backend and ms access frontend. Almost all tables are linked tables with the SQL database,...
5
by: JD | last post by:
Hi, There are about 10+ 3-D points on the same line. I want to find the two end points from these points. The efficiency is not an issue because there are only 10 points or so. I just need a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.