HI,
How do you find the other endpoint of a line given one endpoint and the
slope of the line.
Also how do you display the coordinate on the computer screen knowing
that the Y axis (of the raster display) runs in the reverse direction of
a normal graph.
ex: given two points
x1 = 100
y1 = 600
and given an angle
45 degrees ie the slope(m)of the line is 1
and given the distance of 206 units
how do I find x2 and y2(the other endpoint of the line)?
how do i display it on the computer screen.
thanks,
Ashutosh 6 2640
"Ashutosh Iddya" <u2******@anu.edu.au> wrote in message
news:3f********@clarion.carno.net.au... HI,
How do you find the other endpoint of a line given one endpoint and the slope of the line.
Also how do you display the coordinate on the computer screen knowing that the Y axis (of the raster display) runs in the reverse direction of a normal graph.
ex: given two points x1 = 100 y1 = 600
and given an angle 45 degrees ie the slope(m)of the line is 1 and given the distance of 206 units how do I find x2 and y2(the other endpoint of the line)?
how do i display it on the computer screen.
thanks, Ashutosh
You need trigonometry, doesn't that get taught in schools any more?
radians = 45*PI/180;
x2 = x1 + 206*cos(radians);
y2 = y1 + 206*sin(radians);
You might need to change a + to a - depending on which way your axis goes.
Note that I convert 45 degrees to radians because sin and cos in C++ need an
angle in radians not degrees.
john
On Thu, 04 Sep 2003 16:25:12 +1000, Ashutosh Iddya <u2******@anu.edu.au> wrote: How do you find the other endpoint of a line given one endpoint and the slope of the line.
Sorry, that's not a C++ question.
Consult your primary school / secondary school / high school math
textbook (depending on the country), or try some other newsgroup.
Also how do you display the coordinate on the computer screen knowing that the Y axis (of the raster display) runs in the reverse direction of a normal graph.
In C++, use a graphics / GUI library.
There are quite a number of free, cross-platform C++ graphics / GUI
libraries.
A short list of free GUI libraries is available at
[ http://www.utvikling.com/cppfaq/04/05/01/index.html].
"Alf P. Steinbach" <al***@start.no> wrote in message
news:3f**************@News.CIS.DFN.DE... On Thu, 04 Sep 2003 16:25:12 +1000, Ashutosh Iddya <u2******@anu.edu.au>
wrote:How do you find the other endpoint of a line given one endpoint and the slope of the line.
Sorry, that's not a C++ question.
Consult your primary school / secondary school / high school math textbook (depending on the country), or try some other newsgroup.
High school text book is unlikely to tell him that he needs to convert his
angle to radians.
john
On Thu, 4 Sep 2003 07:35:41 +0100, "John Harrison" <jo*************@hotmail.com> wrote: "Alf P. Steinbach" <al***@start.no> wrote in message news:3f**************@News.CIS.DFN.DE... On Thu, 04 Sep 2003 16:25:12 +1000, Ashutosh Iddya <u2******@anu.edu.au> wrote: >How do you find the other endpoint of a line given one endpoint and the >slope of the line.
Sorry, that's not a C++ question.
Consult your primary school / secondary school / high school math textbook (depending on the country), or try some other newsgroup.
High school text book is unlikely to tell him that he needs to convert his angle to radians.
<ot>
My secondary school math textbook did (around 1978 or something).
But I thought the level in both secondary school and high school was
extremely low, and had been going downhill for some time, judging from
my sister's books (she's three years older) and my mother's books.
Education system is all downhill, at least in Norway... :-(
</ot>
"Alf P. Steinbach" <al***@start.no> wrote in message
news:3f**************@News.CIS.DFN.DE... On Thu, 4 Sep 2003 07:35:41 +0100, "John Harrison"
<jo*************@hotmail.com> wrote: "Alf P. Steinbach" <al***@start.no> wrote in message news:3f**************@News.CIS.DFN.DE... On Thu, 04 Sep 2003 16:25:12 +1000, Ashutosh Iddya
<u2******@anu.edu.au>wrote: >How do you find the other endpoint of a line given one endpoint and
the >slope of the line.
Sorry, that's not a C++ question.
Consult your primary school / secondary school / high school math textbook (depending on the country), or try some other newsgroup.
High school text book is unlikely to tell him that he needs to convert
hisangle to radians.
<ot> My secondary school math textbook did (around 1978 or something).
Amazing! It told you that the C standard library math routines require
angles in radians. I guess that was what set you on your path to become a
programmer.
But I thought the level in both secondary school and high school was extremely low, and had been going downhill for some time, judging from my sister's books (she's three years older) and my mother's books.
Education system is all downhill, at least in Norway... :-(
Same in the UK.
</ot>
john
Ashutosh Iddya wrote: HI,
How do you find the other endpoint of a line given one endpoint and the slope of the line.
The way you found the startpoint and the equation of the line. Also how do you display the coordinate on the computer screen knowing that the Y axis (of the raster display) runs in the reverse direction of a normal graph.
Depends. For example, if you're programming a toaster, then you don't
have to worry about the display. ex: given two points x1 = 100 y1 = 600
and given an angle 45 degrees ie the slope(m)of the line is 1 and given the distance of 206 units how do I find x2 and y2(the other endpoint of the line)?
If you knwo it's 206 units and you know the slope and the equation of
the line, what more do you need to know to get to the other end? If all
fails, try a bicyle! how do i display it on the computer screen.
thanks, Ashutosh
Sona This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ashutosh Iddya |
last post by:
HI,
How do you find the other endpoint of a line given one endpoint and the
slope of the line.
Also how do you display the coordinate on the computer screen knowing
that the Y axis (of the...
|
by: spivee |
last post by:
I'm having an odd type of issue. I want to be able to pass an element
name in my javascript event and find the location of the element, be it
a div, span, img whatever, specifically the top and...
|
by: nescio |
last post by:
hello,
i have a script that finds the x and y from the mouse position, this works
fine.
but now i have an image in a layer :
<div id='someLayer'>
<img src='someImage.jpg'>
</div>
|
by: OtisUsenet |
last post by:
Hello,
Is there a way to use JavaScript to push a page element (a DIV block,
for example) down the screen, so it sits at the bottom of the browser
window.
For example of a bad footer...
|
by: peradino |
last post by:
Hi
I have a problem when I want to know how far my cursor is from the top of pictureBox.
I can get mouse coordinate but it is screen coordinate.
I can get the top position of my pictureBox...
| |
by: Eric.Gabrielson |
last post by:
Hello,
I am very knew to python and am attempting to write a program
in python that a friend of mine is having to write in java. I am doing
this for fun and would like some help as to how i can...
|
by: galathaea |
last post by:
On Mar 2, 11:29 pm, galath...@veawb.coop (galathaea) wrote:
still being very naive about this whole crackpot / crank thing
i accidentally let the engineer inside think too hard about this
...
|
by: sklett |
last post by:
I have a situation where I'm getting in Image that has a gray (solid, same
color) background with a smaller white rectangle inside. The position is
not always the same. What I need to do is...
|
by: jigsmshah |
last post by:
I need to print a text file .When i print it ,it is not printed exactly form 0,0 coordiante of the page. I mean the top most left corner.It is leaving some margin from top and from left.The code is...
|
by: zion4ever |
last post by:
Hello good people,
Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields 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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |