# Plotting in projective space

I am having difficulty figuring out how to plot to projective space. Suppose I have a region which I have plotted such as:

RegionPlot[2 <= x <= 5 && 2 <= y <= 5, {x, -5, 10}, {y, -5, 10}]


How would I convert this to the projective plane, i.e. it would require transforming the plot into homogenous coordinates and then mapping it onto a sphere...

Similarly, with a 1 dimensional region, such as if I have $2 \le x \le 5$, how would I plot that onto the projective line which is a circle?

So for example Is a solution in one dimensions to the interval equation [-1,2]x = [5,100].

The solution to this is $(-\infty, -5] \cup [\frac{5}{2}, \infty)$. These intervals are denoted on the real axis as the bold lines. I want to map them onto that circle and shade the regions below the lines.

I have found the following http://demonstrations.wolfram.com/HomogeneousCoordinatesAndTheProjectivePlane/

Here is an example of a 2D region I plotted: Some other systems I plot aren't bounded and hence tend to infinity on both axes hence why I would like to be able to plot these to a projective plane so that I can represent infinity.

I tried doing this with the function provided by the kind gentlemen below: As you can see the plot is empty, but it definitely shouldn't be seeing as the plot in 2D above it has quite a large region filled in

• Not sure what you mean by "convert this to the projective plane". Can you give an example of what you want the plot to look like in the end?
– user484
Aug 7, 2014 at 20:58
• I have edited the post with an example now :) Aug 7, 2014 at 21:08

If (a,b) is a point in Affine space, then its projective coordinates are [a:b:1]. To select the representative on the unit sphere we can choose (a/r,b/r,1/r) where r=sqrt(a^2+b^2+1). Revering the transformation, given a point on the unit sphere (x,y,z) we can recover the affine point [a:b:1] as [x/z:y/z:1]. Using this idea try:

ContourPlot3D[x^2 + y^2 + z^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
RegionFunction->Function[{x, y, z}, 2 < x/z && x/z < 5 && 2 < y/z && y/z < 5]]


Is this what you had in mind?

• I had something like that in mind yes, but my system of inequalities is much more complicated in my actual situation, e.g. I would need to plot the region defined by this: x1 >= 0 x2 >= 0 2*x1 + 0*x2 <= 120 3*x1 + 1*x2 >= 0 1*x1 + 2*x2 <= 240 2*x1 + 3*x2 >= 60 x1 <= 0 x2 >= 0 3*x1 + 0*x2 <= 120 2*x1 + 1*x2 >= 0 2*x1 + 2*x2 <= 240 1*x1 + 3*x2 >= 60 x1 >= 0 x2 <= 0 2*x1 + 1*x2 <= 120 3*x1 + 0*x2 >= 0 1*x1 + 3*x2 <= 240 2*x1 + 2*x2 >= 60 x1 <= 0 x2 <= 0 3*x1 + 1*x2 <= 120 2*x1 + 0*x2 >= 0 2*x1 + 3*x2 <= 240 1*x1 + 2*x2 >= 60 What would I do in such a scenario? Aug 7, 2014 at 21:44
• Where you put the inequalities that's where I put the system I just gave you except I stuck && between all of them and after each 6 inequalities its an ||, I'll edit the post and add another example. Aug 7, 2014 at 21:47
• I have made a further edit showing what I tried with your formula Aug 7, 2014 at 22:03
• Also, I need it to map properly to projective plane for a 2D system and projective line for a 1D system and I would also like to see the sphere and circle on the plots as well as the appropriate shaded regions. If you could show me all this I would be sooooo happy Aug 7, 2014 at 22:21
• Oh lastly I don't think what you have done will work because as you can see here, en.wikipedia.org/wiki/Real_projective_line Division by zero is allowed in the projective space so I don't see how this addresses that issue. I want to be able to represent the point at infinity in my plots as a point (X,0) for 1 dimensional projective space i.e. the projective line and (X,Y,0) for the projective plane Aug 7, 2014 at 22:29