/**
 * 
 */
package org.shelbourne.adam.gravity1;
import static org.shelbourne.adam.gravity1.ThreeDimensionVector.ZERO;

/**
 * @author gamep_000
 *
 */
public class Projectile {
	
	private static final Double GRAVITATIONAL_FIELD = -9.81; 
	
	private ScannerDto scannerDto;
	
	public Projectile (ScannerDto scannerDto) {
		this.scannerDto = scannerDto;
	}
	
	public void calculate(){
		ThreeDimensionVector tdv = new ThreeDimensionVector(scannerDto);
		Double velocityY = ZERO;
		ThreeDimensionVector displacementY;
		Double yAdjust = GRAVITATIONAL_FIELD * scannerDto.getDeltaT();
		while (tdv.getyAxis() > ZERO) {
			tdv = tdv.addVertical(yAdjust);
			tdv = tdv.increaseBy(scannerDto.getDeltaT());
		}
	}
	

}

@@ -47,16 +47,18 @@
 vity1;%0D%0A
+%0D%0A
 import s
@@ -185,17 +185,16 @@
 tile %7B%0D%0A
-%09
 %0D%0A%09priva
@@ -248,12 +248,10 @@
 .81;
- 
 %0D%0A
-%09
 %0D%0A%09p
@@ -281,17 +281,16 @@
 erDto;%0D%0A
-%09
 %0D%0A%09publi
@@ -301,17 +301,16 @@
 ojectile
- 
 (Scanner
@@ -365,17 +365,16 @@
 o;%0D%0A%09%7D%0D%0A
-%09
 %0D%0A%09publi
@@ -391,16 +391,17 @@
 culate()
+ 
 %7B%0D%0A%09%09Thr
@@ -469,36 +469,40 @@
 %0D%0A%09%09
-Double velocityY = ZERO;%0D%0A%09%09
+ThreeDimensionVector tdv1 = new 
 Thre
@@ -521,22 +521,20 @@
 ctor
- displacementY
+(scannerDto)
 ;%0D%0A%09
@@ -610,16 +610,17 @@
 ile (tdv
+1
 .getyAxi
@@ -687,18 +687,13 @@
 tdv.
-increaseBy
+scale
 (sca
@@ -721,16 +721,119 @@
 %0D%0A%09%09
-%7D
+%09tdv1 = tdv1.increaseBy(tdv);
 %0D%0A
+%09
 %09%7D%0D%0A%09
+%09Double xdistance = tdv1.getxAxis();%0D%0A%09%09System.out.println(xdistance);%0D%0A%09%7D
 %0D%0A%0D%0A

Update 2