Did you meen in 3D space or in 2D...if in 2D, then Medhak is right....if you ment in 3D, then I can give you an other solution...but I don't want to botter my self with it if you didn't wonder...
Then you can plot it into a XY coordinate system...
Say if you say that x is 2 then y will be 4. Plot that into the coornate system, then you can say that x = -2 then y will be -4. Plot that into the coordnate system. Then you can draw the line between the two points and you have the line........do that for both of the Y functions...
gauss elimination is effective to solve linear equation systems.. you can google on it.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Originally posted by BodwadUK Ok assume i have two lines in a grid
Line1 = 1,2 to 4,5
Line2 = 1,4 to 5,1
How does the go???
With a drawing it intersects as 2,3
if you want to detect collision between two lines (with start and ending point) you need their equations first, and the line equation is y=kx+c where k=dy/dx where dy = difference between points in y axis and similar for dx. c=y-kx, pick either points. solve x for both equations and finally, test of the solution is between the points x and y wise for both lines.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
nD space you can do linear algebra in hyperspace *telefrags note from another dimension*
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
yeah thats about it, gausselimination is just a more systematic way of doing it still though its not that simple, if you have to test if two fragments of line intersect
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
I have never used Gauss eleminasjon in 2D space....but it is a good way to do it for 3D.....most calculators are using gauss for calculating Matrices...
yeah but matrices are not necessarily 3d.. of course you can have one million way of doing things instead of one generic way, if you think its faster, but i prefer remembering one way.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
yeah school sucks I think most of the stuff we learn there are just rubbish..
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Yeah it is...and that is not all....to get a degree you have to take a lot of classes that is rubbish too......I am never going to use my chemestry knowledge...but I had to take it to get my master in informatics...
thats just silly.. we have two degrees in computer science that one is more technical and includes stuff like electronics, physics and chemistry and all kind of engineering stuff.. its just waste of time imo, so I decided to switch to the other degree with more theoretical stuff, where I at least get to decide what I want to learn
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
We have the same classes here in Norway the 2 first years...the 1-3 next years you can choose network...or programming....but the 2 first years you have to have classes like chemestry, statestic (is that a English word) and economics, and stuff like that.....I hate it...but I am trying to get thrue it so I can be a hardcore programmer in the end.....
PS: I got the phone number to the most beautiful girl out on town tonight......She is sooooo hot....wish me luck.....(I am still drunk)....