Here you can find the source of dot(final Point2D a, final Point2D b)
Parameter | Description |
---|---|
a | The first vector. |
b | The second vector. |
public static final double dot(final Point2D a, final Point2D b)
//package com.java2s; //License from project: Open Source License import java.awt.geom.Point2D; public class Main { /**/*from w w w . jav a 2 s .c o m*/ * Calculates the dot product of two vectors. * * @param a * The first vector. * @param b * The second vector. * @return The dot product. */ public static final double dot(final Point2D a, final Point2D b) { return a.getX() * b.getX() + a.getY() * b.getY(); } }