Minimap issue

Here’s the issue: I have a circular minimap. On that minimap, I want to display objective locations. However, if you’re far enough away that the objective would normally be drawn past the edge of the minimap, I just want it to put a symbol at the edge of the map. Now, I’ve already got the trigger set up with the following code:

		if((Mathf.Sqrt(((objPos.x) * (objPos.x)) + ((objPos.y) * (objPos.y)))) > 65)//if the objective is more than 65 pixels from the center of the map...
		var bill = Mathf.Tan(objPos.x/objPos.y);
		var x = Mathf.Cos(bill);
		var y = Mathf.Sin(bill);
		GUI.DrawTexture(Rect(x - 25,Screen.height - y - 25,50,50),HighObjectiveIcon); // draw the actual icon on the screen

EDIT: I’ve updated the code a bit (ignore the awesome naming conventions, I was in a rush, haha). This is CLOSE, but not exact. It now is correctly triggering and redrawing the dot as soon as it goes outside of the circle or comes back into it, but instead of leaving it at the edge, it just draws it in the corner of the screen, haha. Thoughts?

Assuming your minimap is circular (not square like I initially assumed it was), you can try converting the coordinates to a circular coordinate system, and then limiting the radius before converting it back to a cartesian one! All of the functions for this are in the Mathf class- you are already using the one to get the radius in your script above, so all you need is the angle- determined by

Mathf.Atan2(objPos.x, objPos.y);

Now you can change the radius back to 65 (your state limit) and convert them back into the cartesian coordinates that your typical screen outside of submarine sonar displays can understand, using Sin and Cos.