Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old August 22nd, 2004, 12:56 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

think off the ways I told you and tell me the results.

--------------------------------------------
Mehdi.:)
Reply With Quote
  #12 (permalink)  
Old August 23rd, 2004, 11:41 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

I dont know where is the original poster?!!!!
But I want to go on this thread...
well,
in way 2,I told you we should have a function that determines if two lines intersect each other or not but How we can implement it?!!!
its quite easy.
if you know some algebra and arithmetic you can easily solve this problem
suppose we have two lines

L1(x1,y1,x2.y2)
L2(a1,b1,a2,b2)

so in plane page(X,Y coordinate)

L1:(y-y1)/(x-x1)=(y1-y2)/(x1-x2)
L2:(y-b1)/(x-a1)=(b1-b2)/(a1-a2)

now we should find the intersection point ,if there is not that means this two lines dont intersect each other at all but if there is one we should check if this point is included in both linesif so that means this two lines intersect each other
for getting the intersection point we can use Kramer method(sorry for the dictation if its wrong)
for checking if a point is included in a line we should write another method I will explain it in my next post.
any opinion!!!!!
(I'm just like you a student hope you contribute in this discussion!)

--------------------------------------------
Mehdi.:)
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Entirely redundant function? RoryBecker BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 0 May 30th, 2008 05:16 AM
redundant SQL logic fkish SQL Language 3 November 12th, 2007 01:28 PM
compare these date fields and compare and get the susanring Oracle 1 July 24th, 2006 04:58 PM
Eliminating Redundant Records spraveens MySQL 1 May 12th, 2004 04:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.