D
Darren J. Young
Another math problem....
Given 3 points (X1,Y1)(X2,Y2)(X3,Y3) that define an arc (Start, Mid, and
End) I'm looking for a good formula that will return the start and end
angles. I'm not talking about the angles they form in relation to each
other, but the angles that represent their actual orientation in space.
I've got a whole ton of different arc formulas that I think I can work
into giving me what I want but I know it'll and up being 6 pages of
code. I know someone here would be better at producing a shorter more
efficient formula.
As my reward, here's my formula to give a radius based on an arc's chord
and it's sagitta length (line from mid point of chord to mid point of
arc) although I'd assume if you have the answer to my question, this
would have been a cake walk.
English version...
Radius = ((ChordLength / 2)^2 + SagittaLength^2) / (2 * SagittaLength)
Lisp version...
(/ (+ (expt (/ chord-length 2) 2) (expt sagitta-length 2))
(* sagitta-length 2.0)
)
--
Darren J. Young
CAD/CAM Systems Developer
Cold Spring Granite Company
202 South Third Avenue
Cold Spring, Minnesota 56320
Email: [email protected]
Phone: (320) 685-5045
Fax: (320) 685-5052
Given 3 points (X1,Y1)(X2,Y2)(X3,Y3) that define an arc (Start, Mid, and
End) I'm looking for a good formula that will return the start and end
angles. I'm not talking about the angles they form in relation to each
other, but the angles that represent their actual orientation in space.
I've got a whole ton of different arc formulas that I think I can work
into giving me what I want but I know it'll and up being 6 pages of
code. I know someone here would be better at producing a shorter more
efficient formula.
As my reward, here's my formula to give a radius based on an arc's chord
and it's sagitta length (line from mid point of chord to mid point of
arc) although I'd assume if you have the answer to my question, this
would have been a cake walk.
English version...
Radius = ((ChordLength / 2)^2 + SagittaLength^2) / (2 * SagittaLength)
Lisp version...
(/ (+ (expt (/ chord-length 2) 2) (expt sagitta-length 2))
(* sagitta-length 2.0)
)
--
Darren J. Young
CAD/CAM Systems Developer
Cold Spring Granite Company
202 South Third Avenue
Cold Spring, Minnesota 56320
Email: [email protected]
Phone: (320) 685-5045
Fax: (320) 685-5052