473,471 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

intersecting lines

3 New Member
I'm making a program that has two constructors for a Line (point and slope) and (2 points). I want to make a boolean method for if the two lines intersect or are parallel and need code for that since I'm really stuck.
Oct 12 '08 #1
4 2633
Laharl
849 Recognized Expert Contributor
If they intersect, what does that mean about the point where they intersect?

If they are parallel, what does that mean about their slopes?

Ignore code right now, just think mathematically.
Oct 12 '08 #2
mkk572ny
3 New Member
Yea i know about how it works but i just can convert that into code idk y
Oct 13 '08 #3
Laharl
849 Recognized Expert Contributor
Work out the algorithm you need to use, every last step, then try to translate it into code. Start with parallel, as it's easier, then go to the intersection. Work through a couple examples to get the feel of what steps are needed if you're having trouble. Also, note that there are a few different methods you can use to check for intersection. Which you pick will directly affect how easy it is to translate.

When you do get to the code, I would recommend storing each line in standard form (Ax+By=C) (note that all you actually need to store are A, B, and C) and using that as a base for your computations.
Oct 13 '08 #4
N002213F
39 New Member
Yea i know about how it works but i just can convert that into code idk y
Then just convert the formula to code. make something subject of formula, calculate and check the result.
Oct 17 '08 #5

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

Similar topics

2
by: Jesse Noller | last post by:
I am a relative newbie to python and I am having issues trying to iterate over the lines of a file. I have a text file - foo.bar inside of this file are lines of text: x-3411342 y-1324123...
1
by: Xeon | last post by:
Hi, I got a XML data node like this : <item firstkey="01" secondkey="02"/> I setup 2 lookup tables by : <xsl:key name="key1" match="item" use="@firstkey"/> <xsl:key name="key2"...
5
by: Brian | last post by:
Hello all.. Am working on an Air Hockey game... have an table loaded into a picture box. The borders of the table are slightly slanted. Am using hit testing lines with GDI+ to manipulate the...
2
by: m00nm0nkey | last post by:
Ok well i thought i'd try a different approach, so what I'm now trying is appending 50,000 lines from the collection to a stringbuilder, and then writing that entire stringbuilder to a file. ...
11
by: lovecreatesbeauty | last post by:
For example, line L1 and line L2 are two lines in two-dimensional space, the start-points and end-points can be described with following the `point_t' type. The start-points and end-points are:...
82
by: Edward Elliott | last post by:
This is just anecdotal, but I still find it interesting. Take it for what it's worth. I'm interested in hearing others' perspectives, just please don't turn this into a pissing contest. I'm in...
11
by: Girish Sahani | last post by:
I wrote the following code to concatenate every 2 keys of a dictionary and their corresponding values. e.g if i have tiDict1 = tiDict1 = {'a':,'b':} i should get tiDict2={'ab':} and similarly for...
7
by: peraklo | last post by:
Hello, there is another problem i am facing. i have a text file which is about 15000 lines big. i have to cut the last 27 lines from that file and create a new text file that contans those 27...
19
by: Pavan | last post by:
Hi, I want to know if there is any software for measuring lines of code of my c++ application. I found out a tool, sloccount, but it gives only physical lines of code. I found out one more...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
0
jinu1996
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...
1
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...
0
tracyyun
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, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.