MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Beginner Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66588] RE: [mg66561] Beginner Question
  • From: spiraltooth <spiraltooth at optonline.net>
  • Date: Sun, 21 May 2006 00:29:33 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

xA=x(A)
xB=x(B)
xC=x(c)
yA=y(A)
yB=y(B)
yC=y(C)
m=(yA-yB)/(xA-xB)
b=yA-(m*xA)
If[xC-((yC-b)/m)<0,Left,Right]


For example if point A is {1,2} and point B is {2,3} and point C is {3,4}:

xA = 1
xB = 2
xC = 3
yA = 2
yB = 3
yC = 4
m = (yA - yB)/(xA - xB)
b = yA - (m*xA)
If[xC - ((yC - b)/m) < 0, Left, Right]
Out[1]=
1

Out[2]=
2

Out[3]=
3

Out[4]=
2

Out[5]=
3

Out[6]=
4

Out[7]=
1

Out[8]=
1

Out[9]=
Right


Best regards,
Alan
-----Original Message-----
From: akil [mailto:akil39 at gmail.com] 
To: mathgroup at smc.vnet.net
Subject: [mg66588] [mg66561] Beginner Question

Hi,

Suppose I have three 2D points A, B, C.
And two points, namely A and B form a line. 

How can I determine in mathematica on which side, (so which half-plane
formed by) of the line, point C is.

So when I input three points I want to know if the third point is on the
left or right side of the half plane formed by the line (ray) A,B.

Appreciate any help.




  • Prev by Date: can't pass argument to a Java method that takes a character array
  • Next by Date: Re: Beginner Question
  • Previous by thread: Re: Beginner Question
  • Next by thread: Re: Beginner Question