VecmathUtil { static double adjacentLength(Vector2d hypotenuse, Vector2d adjacent, double oppositeLength) { return Math.tan(hypotenuse.angle(adjacent)) * oppositeLength; } private  VecmathUtil();   }
@Test public void testAdjacentLength() throws Exception { double length = VecmathUtil.adjacentLength(new Vector2d(2, 4), new Vector2d(9, 4), 6d); assertThat(length, closeTo(4.94, 0.01)); }