|
|
> I almost feel embarassed for not knowing how to do this, but I have
> forgotten almost all the math I learnt at school. Anyway, here's my
> question:
>
> Please see the attatched image. If I know point A, and I know point C, and
> the length of A to B and B to C are always constant, how can I find point
B?
> Is it some Pythagorean thing? I am currently working in 2 dimensions.. all
> points are at x*0. Would any solution be different for 3 dimensions?
>
1. You shouldn't post binaries AT ALL (no matter how small) here
2. I don't have the math solution at the moment but I can tell you the
following:
assume Lab=Lcb=L
a) if L<Lac then there is no solution
b) if L=Lac then there is one solution, the midway point between A and C
(this is easy to figure out)
c) if L>Lac, in 2D there are two solutions, in 3D the solution lies
anywhere on a circle
think of it as two circles (or spheres in 3D) of radius L at A and C, B is
the intersecting point.
-tgq
Post a reply to this message
|
|
|
|
You must know the angle in order to solve this. Any triangle can be solved
knowing "side-angle-side" through simple trigonometry. But the simpler approach
has nothing to do with any of this. If you know point A and you know point C,
you have your answer through (as you guessed it) the Pythagorean theorem. Let's
assume that point A is represented by (x1,y1) and point C is represented by (x2,
y2). Then the distance from A to C is very simple:
X = (x2-x1)
Y = (y2-y1)
D = sqrt((X*X) + (Y*Y))
Since X may be negative or positive (and also the same is true for Y), you
may expect to take an absolute value or something, but this is not necessary.
Squaring the term automatically resolves it as a positive value. The square
root of the sums of the squares gives the distance.
Cheers!
Chip Shults
My robotics, space and CGI web page - http://home.cfl.rr.com/aichip
Post a reply to this message
|
|
|
|
You may have figured it out but I'll post this any ways since I just
finished it, let me know if you have any questions.
Given Pts A & C and length D as well as pt P which lies on the desired plane
the macro calculates and returns B1 and B2, the two possible intersection
pts
note: if 2*L< Lac, you will get an error
also you need to initialize pts B1 and B2 for the macro to work
-tgq
//A = pt 1
//C = pt 2
//P = 3rd point on the desired plane
//L = distance from A & C to B
//B1, B2 = two possible points on the desired plane
// predeclare B1 and B2 as anything (i.e. <0,0,0>)
// they will be assigned approprite pts by the macro
#macro TwoPts (A,C,P,L,B1,B2)
#local N=vnormalize(vcross(vcross(C-A,P-A),C-A));
#local D=(A+C)/2;
#local L2=sqrt(L^2-vlength(D-A));
#local B1=D+N*L2;
#local B2=D-N*L2;
#end
//sample scene illustrating the geometry
camera{
location <5,5,-5>
look_at 0
}
light_source{y*100 rgb 1}
#declare A=<0,0,0>;
#declare C=<1,1,1>;
#declare P=<-4,0,2>;
#declare L=2;
#declare B1=<0,0,0>;
#declare B2=<0,0,0>;
TwoPts (A,C,P,L,B1,B2)
sphere{A .1 pigment{rgb<1,0,0>}}
sphere{C .1 pigment{rgb<1,0,0>}}
sphere{P .1 pigment{rgb<0,1,0>}}
sphere{B1 .1 pigment{rgb<1,1,0>}}
sphere{B2 .1 pigment{rgb<1,1,0>}}
plane{
vcross(C-A,P-A) 0
pigment{
object{
union{
difference{
sphere{A L}
sphere{A L*.99}
}
difference{
sphere{C L}
sphere{C L*.99}
}
}
rgb 1, rgb 0
}
}
}
// end sample scene
Post a reply to this message
|
|