-
1. Re: how to create dynamic cuves in a right triangle..
kglad Feb 27, 2014 4:03 AM (in response to rahimhaji)use the graphics methods. in particular, the lineTo() method.
-
2. Re: how to create dynamic cuves in a right triangle..
rahimhaji Feb 28, 2014 11:16 AM (in response to kglad)hi kglad,
Greetings! thks for the reply.. i tried this already i dont curve with myshape.graphics.curve to.. but my cuve goes out of the lines.. i mean big. i want to find the distance between two lines a & b and draw the curve.... any body pls help me...
Thanks and Advance...
-
3. Re: how to create dynamic cuves in a right triangle..
kglad Feb 28, 2014 11:31 AM (in response to rahimhaji)what is it exactly that you are trying to do?
and it only makes sense to talk about the distance between two parallel lines (in euclidean space).
-
4. Re: how to create dynamic cuves in a right triangle..
rahimhaji Mar 1, 2014 4:14 AM (in response to kglad)Dear Mr.kglad,
Greetings! iam trying exactly in the link below:
http://www.mathopenref.com/cosine.html
i done all except a curve (angle shows 30 & 60 degree). i tried the following code:
var len:Number = ((2 * Number(len1_txt.text)) / Number(len2_txt.text))*10;
trace("length :"+len);
var cur3start:Point = new Point(point3.x - 20,point3.y);
my_shape.graphics.moveTo(cur3start.x,cur3start.y);
my_shape.graphics.curveTo(point3.x-30,point3.y-(len/2),point3.x-20,point3.y-len);
here pont 1 is point A, and pont3 is point C xy coordinates. it is coming correctly.. going out of bothte lines b & c.. ur help will be highly appreaciated..
Thanks in advance...
-
5. Re: how to create dynamic cuves in a right triangle..
kglad Mar 1, 2014 5:16 AM (in response to rahimhaji)to duplicate what you see at that link, you would only need to draw lines (not curves) connecting 2 points and you would only need to calculate the distance between 2 points (not lines):
function distanceF(x1:Number,y1:Number,x2:Number,y2:Number):Number{
return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
function drawLineF(dobj:DisplayObject,x1:Number,y1:Number,x2:Number,y2:Number):void){
with(dobj.graphics){
lineStyle(1,0x000000);
moveTo(x1,y1);
lineTo(x2,y2);
}
}
-
6. Re: how to create dynamic cuves in a right triangle..
rahimhaji Mar 2, 2014 8:04 AM (in response to kglad)Dear Mr.kglad,
Greetings! thks for the code.. It did not work out. i need to create a curve shape near the point A and C.
Thanks in advance
-
7. Re: how to create dynamic cuves in a right triangle..
kglad Mar 2, 2014 9:19 AM (in response to rahimhaji)are you trying to draw the angle marker arcs?
-
8. Re: how to create dynamic cuves in a right triangle..
rahimhaji Mar 2, 2014 10:08 AM (in response to kglad)Yes mr.kglad. Iam trying to draw the angle marks near point A and point B. i have done all triangle side lentths and angles. i found all except the angle marks near that pints.. pls help me.. i got its coming like big size see my posted code.
Thanks in Advance...
-
9. Re: how to create dynamic cuves in a right triangle..
kglad Mar 2, 2014 5:58 PM (in response to rahimhaji)that's going to take a fair amount of work. you can find the equation for each line segment when you draw the line using:
function drawLineF(mc:MovieClip, x1: Number, y1: Number, x2: Number, y2: Number): void {
with(mc.graphics) {
lineStyle(1, 0x000000);
moveTo(x1-mc.x, y1-mc.y);
lineTo(x2-mc.x,y2-mc.y);
}
mc.m = (y1-y2)/(x1-x2);
mc.b = y1-mc.m*x1;
}
then you can determine the end points of the arc using the line segment equations and the distance you want the arc to be from a vertex (using the quadratic formula) and you can set the control point to be on the angle bisector about twice the distance from the vertex as the arc.


