Calculator Inputs
Example Data Table
| Example | Shape A | Shape B | Weights | p | Distance | Similarity |
|---|---|---|---|---|---|---|
| 1 | Circle, radius 5 | Ellipse, semi-axes 6 and 4 | All weights = 1 | 2 | 0.4073 | 66.55% |
| 2 | Rectangle, 8 by 6 | Rectangle, 8.5 by 6 | All weights = 1 | 2 | 0.0979 | 90.67% |
| 3 | Triangle, sides 5, 6, 7 | Custom, A=15, P=18, W=7, H=5 | All weights = 1 | 2 | 0.2344 | 79.11% |
Formula Used
- Area and perimeter are computed from the selected shape. Circle uses πr² and 2πr. Rectangle uses w × h and 2(w + h). Triangle uses Heron’s formula. Ellipse perimeter uses Ramanujan’s approximation.
- Aspect Ratio = major dimension ÷ minor dimension.
- Compactness = 4πA ÷ P². A perfect circle gives 1.
- Equivalent Diameter = √(4A ÷ π).
- Rectangularity = A ÷ (W × H), where W and H are bounding dimensions.
- Normalized descriptor difference = |xA − xB| ÷ s, where s is either the average scale or maximum scale.
- Final distance = [Σ wi(di)p]1/p, where wi is the descriptor weight and p is the Minkowski order.
- Similarity score = 100 × e−Distance.
How to Use This Calculator
- Choose a shape type for Shape A and Shape B.
- Enter the required dimensions for each shape.
- Adjust descriptor weights to emphasize the features you care about most.
- Select the Minkowski order. Use 1 for linear sensitivity, 2 for standard Euclidean behavior, or larger values to penalize larger descriptor gaps more strongly.
- Pick the normalization method. Average scale is balanced. Maximum scale is slightly stricter when one value is much larger.
- Click the calculate button. The result appears above the form with a table, interpretation, CSV download, PDF download, and Plotly graph.
Frequently Asked Questions
1) What does shape-based distance measure?
It measures how different two shapes are through descriptor values such as area, perimeter, aspect ratio, compactness, equivalent diameter, and rectangularity. A lower distance means the shapes are closer in descriptor space.
2) Is this a physical distance between points?
No. It is a mathematical comparison score built from shape descriptors. The result shows structural similarity, not travel distance, edge-to-edge distance, or distance between coordinate points.
3) Why can equal areas still produce a large distance?
Two shapes may share the same area yet differ in perimeter, compactness, or aspect ratio. The calculator checks multiple descriptors, so matching only one measure does not guarantee a small distance.
4) What happens if all weights are equal?
Each descriptor contributes evenly to the final distance. This is a good starting point when you want a balanced comparison without favoring area, compactness, or another feature.
5) Which Minkowski order should I choose?
Use p = 1 for a more linear response, p = 2 for standard Euclidean-style comparison, and larger p values when you want the largest descriptor differences to dominate more strongly.
6) When should I use the custom shape option?
Use custom mode when your figure does not fit the built-in formulas. Enter known area, perimeter, and bounding dimensions to compare irregular or externally measured shapes.
7) Does the similarity score represent an exact percentage match?
It is a scaled interpretation of the descriptor distance, not a strict geometric proof of identical shape. Higher values mean closer similarity within the selected descriptor system and weight setup.
8) Can I compare shapes with different sizes?
Yes. Normalized differences help compare shapes across size changes. Still, if scale should matter less, reduce the area and equivalent-diameter weights and emphasize compactness or aspect ratio.