更新时间:2023-02-01 23:26:42
似乎没有一种方法可以做到这一点;但是,使用 PathIterator
s,您应该能够沿着形状的轮廓比较点对点并手动找到距离.
There doesn't seem to be a method that does that exactly; however, using PathIterator
s, you should be able to compare point to point along the outline of the shapes and find the distance manually.
http://docs.oracle.com/javase/6/docs/api/java/awt/geom/PathIterator.html
这篇***文章描述了如何有效地实施这是为了避免二次明显的实现.
This Wikipedia article describes how you could efficiently implement this to avoid the quadratic obvious implementation.