RMweb Premium Ian J. Posted October 18, 2016 RMweb Premium Share Posted October 18, 2016 Hi, I have a question for any maths / geometry whizzes here: given that I know all the values for the bits in the drawing below with the exception of B Θ, how can I work out the angle of B Θ? TIA Link to post Share on other sites More sharing options...
eastwestdivide Posted October 18, 2016 Share Posted October 18, 2016 Is the horizontal line at B parallel to the "bottom of the page" or "X-axis"? If so, it's the same angle as AC makes with the bottom of the page/X-axis, surely. Link to post Share on other sites More sharing options...
Ozexpatriate Posted October 18, 2016 Share Posted October 18, 2016 Is ACB a right angle? Is L a segment of a circle? (AC = R = CB) then Bθ = 90 + Aθ Link to post Share on other sites More sharing options...
RMweb Gold griffgriff Posted October 18, 2016 RMweb Gold Share Posted October 18, 2016 TBH It doesn't mean much as it stands. Griff Link to post Share on other sites More sharing options...
RMweb Premium Ian J. Posted October 18, 2016 Author RMweb Premium Share Posted October 18, 2016 Annoyingly I've just noticed that C forms what appears to be a right angle. That's just coincidence as the angle could be anything. Is the horizontal line at B parallel to the "bottom of the page" or "X-axis"? If so, it's the same angle as AC makes with the bottom of the page/X-axis, surely. Yes, the horizontal line is parallel both on Aθ and Bθ. It's the other line that is the difference from that horizontal that I'm interested in. Is ACB a right angle? Is L a segment of a circle? (AC = R = CB) then Bθ = 90 + Aθ As I've noted at the beginning of this post C may not always be a right angle, even though it looks like one as it stands. Link to post Share on other sites More sharing options...
Kickstart Posted October 18, 2016 Share Posted October 18, 2016 Hi Depends on how far along the circle you want to measure the angle. At the infinitely small place where it intersects with the line the angle will be 90 degrees exactly (assuming C is the centre of the circle) All the best Katy Link to post Share on other sites More sharing options...
Edwin_m Posted October 18, 2016 Share Posted October 18, 2016 Assuming the two tangents to the circle are right angles as above. The angle CΘ between AC and CB is equal to L/R*180/pi degrees Drawing a horizontal through C, the smaller angle between the horizontal and CA is 90-AΘ (same as equivalent angle to horizontal at A) The smaller angle between the horizontal and CB is 180-CΘ-(90-AΘ) or more simply 90-CΘ+AΘ (similar logic to previous line) But the three angles above the horizontal through C must total 180. So 90-CΘ+AΘ=BΘ-90 BΘ=180-CΘ+AΘ I think Link to post Share on other sites More sharing options...
RMweb Premium Ian J. Posted October 18, 2016 Author RMweb Premium Share Posted October 18, 2016 Sorry, I don't have Cθ, and it can't be assumed that the angle at C is 90 degrees, it could be anything. Link to post Share on other sites More sharing options...
£1.38 Posted October 18, 2016 Share Posted October 18, 2016 Just draw it on a large sheet of paper Link to post Share on other sites More sharing options...
RMweb Premium Flying Pig Posted October 19, 2016 RMweb Premium Share Posted October 19, 2016 I get the same result as Edwin_m (see attached sketch). You need to know Cθ (or be able to calculate it from L and R) otherwise Bθ can't be determined. Edit: final result should of course be BΘ = 180 minus CΘ+AΘ Link to post Share on other sites More sharing options...
RMweb Premium Ian J. Posted October 19, 2016 Author RMweb Premium Share Posted October 19, 2016 Thanks for the replies folks, they have helped. The only problem I have now is figuring out how best to use the Javascript Math functions in an HTML canvas when the functions work to a bottom left y axis ascending upwards (as per usual graphs, etc), while the canvas object uses a top left y axis ascending going down... Link to post Share on other sites More sharing options...
RMweb Premium Al51 Posted October 19, 2016 RMweb Premium Share Posted October 19, 2016 Thanks for the replies folks, they have helped. The only problem I have now is figuring out how best to use the Javascript Math functions in an HTML canvas when the functions work to a bottom left y axis ascending upwards (as per usual graphs, etc), while the canvas object uses a top left y axis ascending going down... Y = (whatever the canvas height is) - Y Link to post Share on other sites More sharing options...
RMweb Premium Ian J. Posted October 19, 2016 Author RMweb Premium Share Posted October 19, 2016 Y = (whatever the canvas height is) - Y Yes, that's one possibility I've read. But it means having to keep a check on all Y values wherever they are in the code. There is another option, which is to use a transform to 'reset' the canvas with an origin point in the bottom left corner by 'flipping' it. It has one major drawback which is that any text entered with fillText() ends up upside down (see here, though this doesn't use a transform for the initial flip). However, I reckon a wrapper function around fillText() which flips it back to 'normal' before writing the text then flips it again seems to be an easier way to deal with this (the code below hasn't been tested by me so is only an idea of the function, not a working example): function flipBeforeFillText(text, x, y, ctx) { ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.fillText(text, x, y); ctx.restore(); } Link to post Share on other sites More sharing options...
bertiedog Posted October 19, 2016 Share Posted October 19, 2016 The answer is simple as a formula the angle is 90 plus the angle between horizontal and line CB, however unresolvable in the form shown as no dimension to base an answer on is shown. Link to post Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.