Here you can find the source of dot(Point a, Point b, Point c)
Help function:
This function calculates the dot product of vector ab and bc.
Parameter | Description |
---|---|
a | - one of the given point |
b | - one of the given point |
c | - one of the given point |
static int dot(Point a, Point b, Point c)
//package com.java2s; import java.awt.Point; public class Main { /**//from w w w .j a v a 2s . c om * <p> * <strong>Help function:</strong> * </p><p> * This function calculates the dot product of vector ab and bc. * </p> * * @return the dot product of ab and bc * * @param a - one of the given point * @param b - one of the given point * @param c - one of the given point */ static int dot(Point a, Point b, Point c) { return (b.x - a.x) * (c.x - b.x) + (b.y - a.y) * (c.y - b.y); } }