Find most right and left point of a horizontal circle in 3d Vector environment
- by Olivier de Jonge
I'm drawing a 3D pie chart that is rendered with in 3D vectors, projected to 2D vectors and then drawn on a Graphics object. I want to calculate the most left and right point of the circle The method to create a vector, draw and project to a 2d vector are below. Anyone knows the answer?
public class Vector3d
{
public var x:Number;
public var y:Number;
public var z:Number;
//the angle that the 3D is viewed in tele or wide angle.
public static var viewDist:Number = 700;
function Vector3d(x:Number, y:Number, z:Number){
this.x = x;
this.y = y;
this.z = z;
}
public function project2DNew():Vector
{
var p:Number = getPerspective();
return new Vector(p * x, p * y);
}
public function getPerspective():Number{
return viewDist / (this.z + viewDist);
}
}