How to determine the number of pixels per unit?

I'm using the LineRenderer to produce a detailed 2D curve. I want to determine the number of pixels per unit based on the distance of the object from the camera and the output resolution of the display. This would allow me to accurately control the resolution of the curve so no matter what display resolution is used, it always appears smooth.

I'd like to do this instead of simply guessing and setting a very high resolution to begin with since on smaller mobile displays this is overkill.

To figure it out with the brute force approach, you would need to convert at least two points at the same distance. Something like:

//Get the screen coordinate of some point
var screenPos : Vector3 = Camera.main.WorldPointToScreen(transform.position);
//Offset by 1 pixel
if(screenPos .x > 0) = screenPos - Vector3.right;
else screenPos + Vector3.right;
if(screenPos .y > 0) = screenPos - Vector3.up;
else screenPos + Vector3.up;
//Get the world coordinate once offset.
var worldOffsetPos : Vector3 = Camera.main.ScreenPointToWorld(screenPos);
//Get the number of world units difference.
var Ratio : Vector3 =
    Camera.main.transform.InverseTransformPoint(transform.position)
    - Camera.main.transform.InverseTransformPoint(worldOffsetPos);

This calculates using screen positions along a plane parallel to the camera's clipping plane which I assume is what you imagine you are looking for.

If you wanted to get an answer that is not transform-relative as this one is, you would pick two pixels diagonally adjacent to each other and get their world positions and do pretty much the same, like so:

//Get the screen coordinate of some point
var screenPos : Vector3 = Vector3(Screen.width/2,Screen.height/2,distance);
//Get the world position of that point
var worldPos : Vector3 = Vector3 = Camera.main.ScreenPointToWorld(screenPos);
//Get the world position of some offset point
var worldOffsetPos : Vector3 = Camera.main.ScreenPointToWorld(screenPos
                                   + Vector3(1.0f,1.0f,0.0f));
//Get the number of world units difference.
var ratio : Vector3 =
    Camera.main.transform.InverseTransformPoint(worldPos)
    - Camera.main.transform.InverseTransformPoint(worldOffsetPos);

Using the projection matrix or screenPointToRay would actually perform perspective projection and your points would curve about the camera, making the question of how many world units go into a pixel a bit more complicated.