/* Usage of this class - VHead head = new VHead2(double,startx, starty, endx, endy); g.fillPolygon(head.xpoints(), head.ypoints(), head.npoints()); */ class VHead2 { private double x1 = 0.0, y1 = 0.0, x2 = 0.0, y2 = 0.0; private double scale = 1; private double t; //angle, theta private double ax1 = -10.0, ay1 = 4.0, ax2 = -10.0, ay2 = -4.0; //default constructor public VHead2() { this.x1=0.0; this.y1=0.0; this.x2=0.0; this.y2=0.0; this.scale = 1; this.ax1 = -10.0*scale; this.ay1 = 4.0*scale; this.ax2 = -10.0*scale; this.ay2 = -4.0*scale; } //constructor public VHead2(double fscale, int fx1, int fy1, int fx2, int fy2) { this.x1 = (double)fx1; this.y1 = -(double)fy1; this.x2 = (double)fx2; this.y2 = -(double)fy2; this.scale = fscale; this.ax1 = -10.0*scale; this.ay1 = 4.0*scale; this.ax2 = -10.0*scale; this.ay2 = -4.0*scale; } //method to return array of x values public int[] xpoints() { int xArray[] = new int[3]; //compute value of theta t = Math.abs(Math.atan((double)(y2-y1)/(x2-x1))); if ((x2=y1)) t = (Math.PI)-t; else if ((x2=x1) & (y2