// Path: src/arbaro/java/net/sourceforge/arbaro/params/FloatFormat.java
// public class FloatFormat {
// 
//     public static NumberFormat getInstance() {
// 	NumberFormat form = NumberFormat.getNumberInstance(Locale.US);
// 	form.setMaximumFractionDigits(5);
// 	form.setMinimumFractionDigits(0);
// 	return form;
//     }
// }


import net.sourceforge.arbaro.params.FloatFormat;
import java.lang.String;
import java.lang.Math;
import java.text.NumberFormat;
/*
 * This copy of Arbaro is redistributed to you under GPLv3 or (at your option)
 * any later version. The original copyright notice is retained below.
 */
// #**************************************************************************
// #
// #    Copyright (C) 2003-2006  Wolfram Diestel
// #
// #    This program is free software; you can redistribute it and/or modify
// #    it under the terms of the GNU General Public License as published by
// #    the Free Software Foundation; either version 2 of the License, or
// #    (at your option) any later version.
// #
// #    This program is distributed in the hope that it will be useful,
// #    but WITHOUT ANY WARRANTY; without even the implied warranty of
// #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// #    GNU General Public License for more details.
// #
// #    You should have received a copy of the GNU General Public License
// #    along with this program; if not, write to the Free Software
// #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// #
// #    Send comments and bug fixes to diestel@steloj.de
// #
// #**************************************************************************/

package net.sourceforge.arbaro.transformation;



/**
 * A x,y,z-vector class
 * 
 * @author Wolfram Diestel
 */
public class Vector {
	final int X=0;
	final int Y=1;
	final int Z=2;
	
	public final static Vector X_AXIS = new Vector(1,0,0);
	public final static Vector Y_AXIS = new Vector(0,1,0);
	public final static Vector Z_AXIS = new Vector(0,0,1);
	
	private double[] coord = {0,0,0};
	
	public Vector() {
		coord = new double[Z+1];
		//coord = {0,0,0};
	}
	
	public Vector(double x, double y, double z) {
		coord = new double[Z+1];
		coord[X] = x;
		coord[Y] = y;
		coord[Z] = z;
	}
	
	public double abs() {
		//returns the length of the vector
		return Math.sqrt(coord[X]*coord[X] + coord[Y]*coord[Y] + coord[Z]*coord[Z]);
	}
	
//	public String povray() {
//		NumberFormat fmt = FloatFormat.getInstance();
//		return "<"+fmt.format(coord[X])+","
//		+fmt.format(coord[Z])+","
//		+fmt.format(coord[Y])+">";
//	}
	
	public String toString() {
// Path: src/arbaro/java/net/sourceforge/arbaro/params/FloatFormat.java
// public class FloatFormat {
// 
//     public static NumberFormat getInstance() {
// 	NumberFormat form = NumberFormat.getNumberInstance(Locale.US);
// 	form.setMaximumFractionDigits(5);
// 	form.setMinimumFractionDigits(0);
// 	return form;
//     }
// }


// Path: src/arbaro/java/net/sourceforge/arbaro/transformation/Vector.java
import net.sourceforge.arbaro.params.FloatFormat;
import java.lang.String;
import java.lang.Math;
import java.text.NumberFormat;

/*
 * This copy of Arbaro is redistributed to you under GPLv3 or (at your option)
 * any later version. The original copyright notice is retained below.
 */
// #**************************************************************************
// #
// #    Copyright (C) 2003-2006  Wolfram Diestel
// #
// #    This program is free software; you can redistribute it and/or modify
// #    it under the terms of the GNU General Public License as published by
// #    the Free Software Foundation; either version 2 of the License, or
// #    (at your option) any later version.
// #
// #    This program is distributed in the hope that it will be useful,
// #    but WITHOUT ANY WARRANTY; without even the implied warranty of
// #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// #    GNU General Public License for more details.
// #
// #    You should have received a copy of the GNU General Public License
// #    along with this program; if not, write to the Free Software
// #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// #
// #    Send comments and bug fixes to diestel@steloj.de
// #
// #**************************************************************************/

package net.sourceforge.arbaro.transformation;



/**
 * A x,y,z-vector class
 * 
 * @author Wolfram Diestel
 */
public class Vector {
	final int X=0;
	final int Y=1;
	final int Z=2;
	
	public final static Vector X_AXIS = new Vector(1,0,0);
	public final static Vector Y_AXIS = new Vector(0,1,0);
	public final static Vector Z_AXIS = new Vector(0,0,1);
	
	private double[] coord = {0,0,0};
	
	public Vector() {
		coord = new double[Z+1];
		//coord = {0,0,0};
	}
	
	public Vector(double x, double y, double z) {
		coord = new double[Z+1];
		coord[X] = x;
		coord[Y] = y;
		coord[Z] = z;
	}
	
	public double abs() {
		//returns the length of the vector
		return Math.sqrt(coord[X]*coord[X] + coord[Y]*coord[Y] + coord[Z]*coord[Z]);
	}
	
//	public String povray() {
//		NumberFormat fmt = FloatFormat.getInstance();
//		return "<"+fmt.format(coord[X])+","
//		+fmt.format(coord[Z])+","
//		+fmt.format(coord[Y])+">";
//	}
	
	public String toString() {
		NumberFormat fmt = FloatFormat.getInstance();