# How can I plot a circular region and lines?

I am having difficulty plotting something along these lines in Mathematica.

I will explain what is going on here. Basically, I am solving an interval equation $ax=b$, in the first example $a = [1, 20]$ and $b =[3, 4]$ and therefore $b/a = [3/20, 4]$. As you can see from the graph I want a circle representing the projective line. A straight line will come off the two end points of the interval which represents the solutions and those lines will go through the center of the circle and the region bounded by the lines should be shaded in.

Similarly the other example below is an unbounded one where $a = [-1,2]$ and $b = [5,100]$ and hence $b/a = (-\infty, -5] \cup [5/2, \infty]$. Same type of plot though, the lines come off $-5$ and $5/2$ on the x axis and go through the center of the circle and the bounded regions are shaded.

• How are the circles constructed? Are they unit circles centered at {0, -1}. Aug 18, 2014 at 18:54
• Yes they are :) Aug 18, 2014 at 19:17
• Oh also letting you know that my solution to the interval equation will be given as a system of inequalities so for the first example above I will be given the following: x1 >= 0 && 1*x1 <= 4 && 20*x1 >= 3 || x1 <= 0 && 20*x1 <= 4 && 1*x1 >= 3 Aug 18, 2014 at 19:20
• It would help to know what you have tried, to avoid unnecessarily spending time explaining things you already did.
– Jens
Aug 18, 2014 at 19:30
• I am completely new to mathematica I have no clue to be honest and need this desperately as soon as possible. Could someone please help? My idea is to figure out the points from the inequalities somehow then make a function that computes a straight line that goes through that point on the x axis and (0,-1) then fill in the region :/ Aug 18, 2014 at 19:39

This is not a complete solution but it may help.

Manipulate[
Graphics[{{Circle[{0, -1}, 1]}, {Blue,
Disk[{0, -1}, 1, {ArcTan[1/b], ArcTan[1/a]}]}, {Blue,
Disk[{0, -1},
1, \[Pi] + {ArcTan[1/b],
If[b < 0, \[Pi], 0] + ArcTan[1/a]}]}, {Green,
Line[{{{a, 0}, {0, -1}}, {{b, 0}, {0, -1}}}]}}, Frame -> True,
PlotRange -> {{-5, 5}, {-3, 1}}, Axes -> True], {a, .1, 3}, {b, -5,
5}]

• This is incredible thanks! How do I modify it so I can see the Circle itself as well rather than just the shaded in areas? Aug 18, 2014 at 20:06
• If i substitute in -5, and 5/2 for a and b respectively, it doesn't exactly plot what I am looking for. Doesn't shade the bottom part? Looks really close though. Any idea how to fix that? Thanks] Aug 18, 2014 at 20:13
• @Kadir (1) add Circle[{0, -1}] to the list of directives. Aug 18, 2014 at 20:26
• @Kadir I have already add the circle. for the range -5 and 5/2, you may change the plot range to include the far distances of a or b. I have already did that. Aug 18, 2014 at 20:30
• You are a brilliant brilliant man, just one last little thing, which value of the intervals have you referred to as a and b, I am getting tad confused when plotting. In the bounded case the interval is of the form [a,b], in the unbounded form its of the form (-infinity, a] UNION [b, +infinity) ? I think you may have swapped the two by mistake but I am not sure? Aug 18, 2014 at 20:37