示例#1
0
def _furthest_point(direction: Point2D, points: List[Point2D]) -> Point2D:
    max_dot = 0.0
    furthest = None
    for point in points:
        current_dot = direction.dot_product(point)
        if current_dot > max_dot or furthest is None:
            max_dot = current_dot
            furthest = point
    return furthest
示例#2
0
def _triple_product_expansion(v1: Point2D, v2: Point2D,
                              v3: Point2D) -> Point2D:
    return v2.mul_by_value(v1.dot_product(v3)) - v3.mul_by_value(
        v1.dot_product(v2))