Brieg
Brieg

Reputation: 63

OpenGL How to draw curves being part of circle depends of last point location with requirements: fixed radius, last point givig direction

I can not put questions in one line also here they are:

How to draw a curve which is part of the circle(depending on the end point)

Let:

Requirements:

EDIT: I think i found solution how to draw that part of circle, please look at that gifs below:

enter image description here

Upvotes: 1

Views: 603

Answers (1)

genpfault
genpfault

Reputation: 52123

diagram

  • Tangent A->B implies a normal-line Q that passes through the (as-yet unfound) circle center D
  • Find the midpoint M of chord R (i.e., segment B-C).
  • A line S perpendicular to R passing through M also passes through D

So: Construct lines Q and S and find their intersection D. The length of segment B-D is the radius of the circle. With the radius and center D you should be able to calculate the arc B->C.

in b4 9000 hours in mspaintpaint.net

Upvotes: 1

Related Questions