I really suck at this, need help, dont even know what to search for.
Look at the picture, its a circle there. The red lines goes from one end of the circle to the other, but i want them to stop at the black line..how can i achive this?
Printable View
I really suck at this, need help, dont even know what to search for.
Look at the picture, its a circle there. The red lines goes from one end of the circle to the other, but i want them to stop at the black line..how can i achive this?
Btw, the lines goes from the middle to 3/4 and 1/4 of the circle
What values are given for you? The radius of the circle?, The starting points of the Lines? The angle betweeen the lines?, the length and position of the black line? and which line goes to 1/4 or 3/4 of the circle (radius, diameter or what)?
Or shall we give you a drawing routine that erases everything outside your circle?
Well..everything outside sounds nice :) But if that doesnt work, lets say the radius is 500 . The lines starts at circle.height / 2..Height of the circle equals the diameter (1000)
The angle of the lines..well..now its just 1/4 and 3/4 from the top..dunno the angle
sounds like you only know the end point of the red lines (Y-Value is 1/4 or 3/4 of the circles diameter and I guess the end value for the X-value is in both cases 0.)
If the red lines shall end at the circle, the X-value can't be 0.
Try it with some trigonometry.
for the top line you have: Start point at (Diameter, Diameter/2) end point at (0, Diameter/4). The difference in Y-Value is Diameter/4, this value is 2*tan (Angle between Line and horizontal diameter of circle).
Having got this angle, you can calculate the sinus and cosinus to compute the corrrect values for the end points.
Opus...ehh, this is some of my problem. My skills in trigonometry is >0, so i need the formula :)
Let me try just for the upper line:
(diameter/4)/(diameter/2)=2*tangens(angle)
1/4=tangens(angle)
14,036°=angle
for your circle with a diameter of 1000 (radius of 500)
sin(angle)*diameter=242,532
cos(angle)*diameter=970,144
so your upper line starts at (1000;500) and goes to ((1000-970,144);(500-242,532))!
I hope you can do the rest for the lower line yourself!
You've just saved my ass, thanks a lot Opus :D
If I've done your homework, the least you could do is rate my post!
Das ist getun :) Its done