Jump to content
 

The non-railway and non-modelling social zone. Please ensure forum rules are adhered to in this area too!

A Geometry Question Regarding Angles


Ian J.

Recommended Posts

  • RMweb Premium

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 Θ?

 

post-6714-0-10631900-1476815002.png

 

TIA

Link to post
Share on other sites

  • RMweb Premium

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

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

  • RMweb Premium

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... :banghead:

Link to post
Share on other sites

  • RMweb Premium

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... :banghead:

Y = (whatever the canvas height is) - Y

Link to post
Share on other sites

  • RMweb Premium

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...