Vector Norms and Distance Metrics in AI: Euclidean, Manhattan, Cosine, and Beyond
L1, L2, cosine, and Minkowski distances — how the choice of metric changes k-NN, k-means, regularization, and nearest-neighbor geometry.
Machine-learning systems constantly compare objects: a new patient with previous patients, a document with a search query, an image embedding with known examples, or a customer with a cluster center. Yet “close,” “similar,” and “different” are not properties that data possess automatically. They are conclusions produced by a mathematical rule. Choosing that rule determines which observations become neighbors, which clusters appear compact, which coefficients are considered small, and sometimes which model wins. This article develops the most important vector norms and distance metrics from first principles, connects their geometry to common AI algorithms, and shows how preprocessing can change the answer even when the raw observations stay exactly the same.
Vector Norms and Distance Metrics in AI: Euclidean, Manhattan, Cosine, and Beyond
Similarity is a mathematical choice
Suppose a recommendation system represents each user by three numbers: weekly viewing hours, fraction of content that is comedy, and average rating. Two users can be compared in several reasonable ways. We might add the absolute feature differences, measure the straight-line distance between them, compare only the direction of their preference vectors, or give some features more importance than others. Each method encodes a different meaning of similarity.
This point is easy to overlook because software libraries expose a metric parameter that looks like an implementation detail. It is not. A metric is part of the model. If a k-nearest neighbors classifier changes from Euclidean to Manhattan distance, its decision boundary may change. If document retrieval changes from Euclidean distance to cosine similarity, the ranking may change. If features are rescaled, the nearest observation may change even though no record was added or removed.
A vector is an ordered list of numbers,
where each coordinate usually represents one feature. A norm maps a vector to a nonnegative number that represents its magnitude:
A norm must satisfy three properties. First, only when . Second, scaling the vector scales its norm by the absolute scaling factor:
Third, the triangle inequality holds:
A norm induces a distance by applying the norm to the difference between two vectors:
A true metric must be nonnegative, equal zero only for identical objects, symmetric, and satisfy the triangle inequality. These conditions make “distance” behave consistently. Some useful dissimilarity scores do not satisfy every metric axiom. For example, squared Euclidean distance is extremely useful in optimization, but it fails the triangle inequality. The distinction matters in algorithms that rely on metric properties for indexing or pruning, even though casual discussion often calls every dissimilarity a distance.
The best metric is therefore not the one that sounds most familiar. It is the one whose assumptions match the representation and the task. Physical coordinates may support ordinary geometric distance. Word-frequency vectors may be better compared by angle. Binary strings may call for Hamming distance. Mixed medical records may require a domain-specific combination. Similarity is designed, not discovered in a vacuum.
The L1, L2, and L-infinity norms
The family of norms provides a unified way to measure vector magnitude. For a finite-dimensional real vector and ,
Three members are especially important in AI.
The L1 norm
The norm adds absolute coordinate values:
For , the result is
The corresponding distance between two points adds their absolute coordinate-wise differences:
This is called Manhattan distance, city-block distance, or taxicab distance. The names evoke travel on a rectangular street grid: moving three blocks east and four blocks north requires seven blocks of travel, not the five-unit diagonal available to a bird.
is less dominated by a single large coordinate difference than squared Euclidean objectives are. It is also associated with sparsity in optimization. An penalty can drive some learned coefficients exactly to zero, which makes it important in Lasso regression and feature selection.
The L2 norm
The norm is the familiar Euclidean length:
For the same vector,
The induced Euclidean distance is
It is the straight-line distance between points. Euclidean geometry is rotation invariant: rotating the coordinate axes without distorting the space leaves distances unchanged. This property is attractive when every direction should be treated equally.
The squared Euclidean distance,
preserves nearest-neighbor rankings because squaring is monotonic for nonnegative numbers. However, the squared quantity is not itself a metric. It is widely used because eliminating the square root simplifies derivatives and because means minimize sums of squared deviations.
The L-infinity norm
The norm keeps only the coordinate with the largest absolute magnitude:
Thus,
The induced distance is
It is also called Chebyshev distance. Imagine a process where all coordinates can change simultaneously at the same maximum rate. The required time is governed by the largest coordinate difference. On a chessboard, a king can move diagonally, so the number of moves between squares is the maximum of the horizontal and vertical displacements.
is useful when the worst individual deviation determines acceptability. A manufacturing part may fail tolerance if any dimension is too far from its target. An adversarial-robustness study may constrain every pixel perturbation to remain below a maximum. Unlike , which aggregates all deviations, focuses entirely on the largest.
Euclidean and Manhattan geometry
The difference between Euclidean and Manhattan distance is more than a formula. Each norm creates its own geometry. One way to see that geometry is to examine all points one unit from the origin.
Under ,
so the unit boundary in two dimensions is a circle. Under ,
so the boundary is a diamond whose corners lie on the coordinate axes. Under ,
so the boundary is an axis-aligned square.
These shapes affect which points count as neighbors. Consider a query at the origin. A point at has Euclidean distance about and Manhattan distance . A point at has Euclidean and Manhattan distances both equal to . Euclidean distance considers the diagonal point slightly closer, while Manhattan distance considers the axis point much closer. A nearest-neighbor model can therefore make a different prediction under the two metrics.
Euclidean distance penalizes distributed coordinate changes through squaring before summation. Manhattan distance charges each unit of coordinate change at a constant rate. In noisy data with occasional large feature deviations, Manhattan distance can be less sensitive to those deviations. That does not make it automatically robust: an extreme coordinate still contributes a large absolute difference, and badly scaled features still dominate.
Correlated features present another issue. If height in centimeters and height in inches both appear, ordinary Euclidean distance effectively counts the same underlying characteristic twice. More generally, Euclidean and Manhattan distances assume that the supplied coordinate axes provide an appropriate representation. Mahalanobis distance addresses scale and correlation by using a covariance matrix:
where is an estimated covariance matrix. Differences along high-variance directions are discounted, while differences along low-variance directions receive more weight. This can be valuable, but covariance estimation becomes unstable with limited data, redundant features, or very high dimension. Regularization may be necessary.
Minkowski distance as a general family
Minkowski distance unifies Manhattan and Euclidean distance:
When , it is Manhattan distance. When , it is Euclidean distance. As approaches infinity, it approaches Chebyshev distance:
Increasing gives the largest coordinate differences progressively more influence. Suppose a difference vector is . Its magnitude is , its magnitude is , and its magnitude is . Although the numeric values decrease as grows in this example, the relative importance of the coordinate with difference increases.
Values sometimes appear in sparse modeling, but the resulting expression is not a norm and does not satisfy the triangle inequality. It is better described as a quasi-norm. Optimization with such penalties can be nonconvex and more difficult. Meanwhile, a weighted Minkowski distance can express feature importance:
Weights should come from domain knowledge, careful validation, or a learned metric—not from arbitrary tuning on the final test set.
Cosine similarity and Euclidean distance
Cosine similarity compares vector direction rather than raw separation:
For nonzero vectors, the value is the cosine of the angle between them:
It ranges from to for real-valued vectors. A value of means the vectors point in the same direction, means they are orthogonal, and means they point in opposite directions. For vectors with only nonnegative components, values usually lie between and .
This directional view is useful when magnitude is a nuisance. In a bag-of-words representation, a long document may contain ten times as many occurrences of every word as a short document while expressing nearly the same topic proportions. Their Euclidean distance can be large, but their cosine similarity is if one vector is exactly a positive multiple of the other.
Cosine distance is often defined as
Despite its name, this form does not satisfy all metric axioms in general, especially the triangle inequality. Angular distance, based directly on the angle, can provide a proper metric:
There is a precise connection between cosine similarity and Euclidean distance. If both vectors are normalized to unit length, then
Therefore, ranking unit-normalized vectors by smallest Euclidean distance is equivalent to ranking them by largest cosine similarity. Without normalization, the equivalence disappears because Euclidean distance responds to magnitude.
Cosine similarity is not universally preferable for embeddings. Magnitude can contain useful information, such as confidence, frequency, popularity, or distance from a learned origin. Normalizing every vector discards that information. The decision should follow the semantics of the representation and empirical validation on the real retrieval or prediction objective.
Why feature scaling changes nearest neighbors
Distance calculations operate on numbers, not on the human meanings attached to units. Suppose a dataset contains age in years and annual income in dollars. A ten-year age difference contributes to Manhattan distance or to squared Euclidean distance. A difference in income contributes or , respectively. Income will dominate even if age is more relevant to the target.
Standardization transforms feature according to
where and are the training mean and standard deviation. Afterward, a one-unit difference represents roughly one training standard deviation. Min-max scaling instead maps a feature to a chosen range, commonly :
Robust scaling uses a median and interquartile range, reducing the effect of extreme values:
No scaling method is neutral. Standardization treats variation relative to standard deviation as meaningful. Min-max scaling is sensitive to extremes and future values beyond the observed range. Robust scaling changes the influence of tails. Domain-based scaling, such as dividing a temperature error by an allowed tolerance, may be more defensible when practical thresholds are known.
To see how a neighbor can reverse, consider query , candidate , and candidate , with coordinates representing age and income. Raw Euclidean distance strongly prefers :
Now suppose age has training standard deviation years and income has standard deviation . In standardized units, the difference to is and the difference to is . The distances become approximately and , so is now closer. Scaling did not merely improve numerical stability; it changed the model’s concept of resemblance.
Preprocessing must be fitted only on the training data. Computing means, standard deviations, minima, maxima, or feature weights from the full dataset leaks information from validation and test records into training. In production, the saved training transformation must be applied unchanged to new observations. The Feature Engineering Calculator is useful for exploring how transformations and feature choices alter downstream geometry.
Distances inside common AI methods
k-nearest neighbors
k-nearest neighbors, or k-NN, predicts from the labels or values of nearby training observations. For classification, a basic rule is
where contains the nearest training vectors under the selected metric. A distance-weighted version gives closer neighbors more influence, often using a weight such as
The metric determines the neighborhood, while controls how local the prediction is. Small can follow noise; large can blur real local structure. Scaling, categorical encoding, missing-value handling, and irrelevant features can matter as much as . Use validation within a preprocessing pipeline to choose the complete configuration. The KNN Calculator helps make neighbor selection and voting visible rather than treating them as hidden library operations.
k-means clustering
Standard k-means minimizes within-cluster squared Euclidean distance:
The arithmetic mean is the optimal cluster representative specifically for this squared Euclidean objective. Replacing Euclidean distance with Manhattan distance while continuing to update centers by the mean is not ordinary k-means and does not preserve its optimization logic. Under an objective, coordinate-wise medians are appropriate representatives, leading toward k-medians. When representatives must be actual observations and arbitrary dissimilarities are allowed, k-medoids is often suitable.
This distinction prevents a common misconception: a clustering algorithm is not just “assign to the nearest center” with any interchangeable distance. Its assignment rule, center update, and objective must agree. Experiment with centroid assignments and inertia in the K-Means Calculator, then compare the behavior with alternative metrics conceptually.
L1 and L2 regularization
Norms also measure model parameters rather than distances between observations. A regularized learning objective combines data error with a penalty. Ridge regression uses a squared penalty:
Lasso regression uses an penalty:
regularization smoothly shrinks coefficients toward zero and tends to share weight across correlated predictors. regularization has corners in its constraint geometry, making exact zero coefficients more likely. Elastic net combines both penalties.
Feature scaling is crucial here too. A coefficient’s numeric magnitude depends on its feature’s units. Without scaling, penalizing coefficients equally does not penalize the real influence of features equally. Intercepts are typically excluded from the penalty. Also, “L2 loss” and “L2 regularization” are different concepts: one measures residuals, while the other constrains parameters.
A worked example on the same three points
Let the query point and two candidate neighbors be
Their difference vectors from are
The metrics do not agree about which candidate is closer. The complete comparison is:
| Comparison from | Manhattan | Euclidean | Chebyshev | Cosine similarity |
|---|---|---|---|---|
| versus | ||||
| versus |
For Manhattan distance,
Manhattan distance therefore selects . The path to requires three units of movement along one coordinate, whereas reaching requires two units along each coordinate, totaling four.
For Euclidean distance,
Euclidean distance selects . Its diagonal displacement is slightly shorter than the three-unit horizontal displacement to .
For Chebyshev distance,
Chebyshev distance also selects , because neither coordinate needs to change by more than two.
Cosine similarity gives another perspective. Since , and point in exactly the same direction, so
For ,
Cosine similarity strongly prefers , even though is farther under Manhattan distance. This is not a contradiction. Manhattan distance asks how much coordinate-wise travel separates the points. Cosine similarity asks how closely their directions align.
The same calculations can be reproduced in Python:
import numpy as np
q = np.array([1.0, 1.0])
a = np.array([4.0, 1.0])
b = np.array([3.0, 3.0])
def cosine_similarity(x, y):
return np.dot(x, y) / (np.linalg.norm(x) * np.linalg.norm(y))
for name, point in {"A": a, "B": b}.items():
delta = q - point
print(
name,
"L1:", np.linalg.norm(delta, ord=1),
"L2:", np.linalg.norm(delta, ord=2),
"L-infinity:", np.linalg.norm(delta, ord=np.inf),
"cosine:", cosine_similarity(q, point),
)
The lesson is not that one result is correct and the others are wrong. The lesson is that a metric supplies the question to which “nearest” is the answer.
Distance concentration in high dimensions
Distance-based intuition is largely formed in two or three dimensions, but AI representations may have hundreds, thousands, or millions of coordinates. As dimensionality grows, several surprising effects appear.
Consider points whose coordinates are sampled independently from similar bounded distributions. A Euclidean squared distance is a sum over coordinates:
As increases, many coordinate contributions accumulate. The absolute distances generally grow, but their relative spread can shrink. Informally, the nearest and farthest points may become similar in distance compared with the overall scale. A common summary is
under particular distributional assumptions as dimension increases. This phenomenon is called distance concentration.
The intuition comes from averaging. In high dimensions, each pairwise distance combines many small random contributions. Unless the data have strong structure, those sums become relatively predictable. A point can be somewhat closer on some coordinates and farther on others, with differences averaging out. The space also becomes sparse: an enormous volume exists, but finite datasets occupy very little of it.
For nearest-neighbor methods, concentration can make the identity of the “nearest” point unstable and the contrast between useful and irrelevant neighbors weak. Adding irrelevant features introduces extra differences that do not help predict the target. This is one aspect of the curse of dimensionality. More data are needed to cover the space, local neighborhoods become less local, and density estimates become difficult.
The effect does not imply that all high-dimensional machine learning is impossible. Real data often lie near lower-dimensional manifolds, contain sparse structure, or use embeddings trained so that meaningful relationships are preserved. Feature selection, principal component analysis, representation learning, metric learning, and regularization can improve the geometry. Cosine similarity can be effective for sparse text, although it does not abolish every high-dimensional problem. Approximate nearest-neighbor indexes accelerate search but cannot repair an uninformative representation.
The practical response is empirical. Compare neighbor-distance distributions, evaluate against labeled relevance or downstream performance, remove irrelevant dimensions, and test stability. Do not assume that a metric successful on a two-dimensional visualization remains informative in a 1,536-dimensional embedding space.
Hamming and other discrete distances
Continuous vector norms are not natural for every data type. Hamming distance counts positions at which two equal-length sequences differ:
For binary strings and , two positions differ, so their Hamming distance is . A normalized version divides by sequence length. Hamming distance is useful for binary codes, categorical attributes encoded position by position, error-correcting codes, and comparing equal-length symbolic sequences.
Jaccard similarity compares sets:
with Jaccard distance . It is especially useful for sparse binary features when shared absences should not count as evidence of similarity. Two customers who both did not buy thousands of products should not appear highly similar merely because of those joint zeros.
Edit distance, or Levenshtein distance, counts the minimum insertions, deletions, and substitutions required to transform one string into another. It handles sequences of different lengths, unlike ordinary Hamming distance. Dynamic time warping compares time series while allowing nonlinear alignment in time. Earth mover’s distance, closely related to Wasserstein distance, measures the work required to transform one distribution into another.
Mixed tabular data can use Gower distance, which combines normalized numeric differences with categorical matches and can accommodate missingness carefully. Graphs, probability distributions, geographic coordinates, and rotations each have specialized notions of distance. Latitude and longitude, for example, should use spherical or geodesic calculations over large geographic regions rather than naive Euclidean distance in degrees.
Choosing a metric systematically
A defensible metric choice begins with the data-generating meaning of each feature. Ask what transformations should leave similarity unchanged. If doubling every count in a document should preserve its meaning, a directional measure may be appropriate. If a one-unit error has constant cost regardless of current magnitude, Manhattan distance may fit. If large deviations should receive increasing emphasis, Euclidean or squared Euclidean objectives may fit. If any single tolerance violation is decisive, may fit.
Next, inspect representation quality. Remove identifiers and leakage variables. Decide how missing values should behave. Encode categorical variables in a way compatible with the metric. One-hot encoding plus Euclidean distance can make categories contribute a fixed geometric cost, but a high-cardinality categorical field can dominate by occupying many columns. Ordinal encodings can falsely imply ordered spacing. Domain-specific similarity may be needed.
Then place preprocessing and metric selection inside validation. For supervised learning, compare candidate pipelines using cross-validation and a task-relevant score. For retrieval, use judged query-result pairs and metrics such as recall at or normalized discounted cumulative gain. For clustering, combine internal criteria with stability, external labels when legitimate, and expert interpretation. Never select a distance solely because it creates the most visually pleasing two-dimensional projection.
Finally, consider computational requirements. Some indexing structures depend on the triangle inequality. Sparse data favor operations that avoid densification. Mahalanobis distance needs a covariance inverse. Learned metrics require enough representative training data. Approximate search systems may support dot product, Euclidean distance, and cosine similarity differently; normalization can sometimes convert one supported operation into an equivalent ranking.
Common mistakes
Treating units as harmless labels
Changing kilometers to meters multiplies a coordinate difference by . Unless scaling or weighting compensates for the conversion, a distance-based model changes. Units are part of the model.
Scaling before the train-test split
Fitting a scaler on all observations leaks test-distribution information. Split first, fit preprocessing on training data, and apply the learned transformation to validation, test, and production inputs.
Calling squared Euclidean distance a metric
It is a useful dissimilarity and produces the same nearest-neighbor ordering as Euclidean distance, but it fails the triangle inequality. That distinction can affect metric-tree algorithms and theoretical claims.
Using cosine similarity with zero vectors
The cosine formula divides by both vector norms. A zero vector has no direction, so its cosine similarity is undefined. Decide explicitly whether to remove zero vectors, assign a convention, or redesign the representation.
Assuming cosine removes every scale issue
Cosine similarity ignores global vector magnitude, not coordinate-wise feature scales. Multiplying one feature column by changes angles and can alter rankings. Feature construction and weighting still matter.
Swapping the k-means metric without changing updates
Means minimize squared Euclidean deviation. Manhattan assignments paired with arithmetic-mean updates do not optimize the standard k-means objective. Use an algorithm whose representative and update rule match its dissimilarity.
Mixing numeric and categorical codes naively
Encoding colors as red , green , blue makes red twice as far from blue as from green under Manhattan distance. The numbers create an artificial order. Use appropriate categorical handling.
Keeping many irrelevant dimensions
Every irrelevant feature adds noise to distance. In high dimensions, this can overwhelm useful neighborhood structure. Feature selection and learned representations are often more important than fine-tuning .
Interpreting “nearest” as “similar in every sense”
A neighbor is near only under the chosen representation, preprocessing, and metric. It may be demographically near but behaviorally distant, or textually similar but factually contradictory. State the scope of similarity.
Selecting the metric on the test set
Trying many metrics and reporting the one with the best test performance turns the test set into a validation set. Choose using training and validation procedures, then evaluate once on held-out data.
Practice with Solver360
The most effective way to learn metric behavior is to calculate a small case by hand, predict what will happen, and then test it.
- Open the KNN Calculator and create a two-feature classification dataset. Place one candidate diagonally from a query and another along one axis. Compare the neighbors you expect under Manhattan and Euclidean geometry.
- Multiply one feature by without changing its meaning. Observe how the neighborhood would change, then standardize the features and compare again.
- Use the K-Means Calculator to follow centroid assignment and update steps. Connect the mean update to the squared Euclidean objective rather than viewing it as an arbitrary averaging step.
- Open the Feature Engineering Calculator and explore standardization, normalization, and transformed features. Ask what notion of similarity each transformation creates.
- Reproduce the three-point example from this article. Before calculating, write down which point you expect each metric to prefer and why.
- Construct two proportional vectors, such as and . Compare their Euclidean distance and cosine similarity. Then perturb one coordinate and observe how the angle changes.
Good practice focuses on explanation, not just arithmetic. For every result, complete the sentence: “These points are similar because the metric values...” If the sentence does not correspond to the real problem, the metric probably does not either.
Frequently asked questions
Is Euclidean distance always the default?
It is a common baseline for continuous, appropriately scaled features, but it is not a universal default. Euclidean distance assumes coordinate differences are meaningful, combines them through squared contributions, and treats directions symmetrically. Sparse text, binary attributes, geographic positions, correlated measurements, and mixed data may require other choices.
Should I use Manhattan or Euclidean distance for k-NN?
Validate both when each is semantically plausible. Manhattan distance can behave better when effects add coordinate by coordinate or when occasional large deviations should have less relative influence. Euclidean distance fits straight-line geometry and is rotation invariant. Scaling and feature relevance often matter more than the difference between the two.
Is cosine similarity the same as Euclidean distance after normalization?
For -normalized vectors, they produce equivalent rankings because
The numeric scores are not identical, but one is a monotonic transformation of the other. The equivalence does not hold for unnormalized vectors.
Why does standardization sometimes reduce model accuracy?
Standardization changes the relative importance of features. It helps when raw units are arbitrary and comparable variation should receive comparable weight. It can hurt when original scale carries valid domain importance or when low-variance noise is amplified. Treat scaling as a model choice and validate it within the training pipeline.
Can distance be negative?
A proper distance metric cannot be negative. Cosine similarity can be negative because it is a similarity, not a distance. Dot products can also be negative. If a software API reports a negative “distance,” inspect its definition; it may return a negated similarity for sorting convenience.
Why does L1 regularization create zero coefficients?
The penalty has a geometry with sharp corners on coordinate axes. When an error contour first touches an constraint region, it often touches at a corner where one or more coefficients are exactly zero. The region is smooth, so Ridge usually shrinks coefficients without setting them exactly to zero.
Does a smaller distance always mean a more confident prediction?
No. A small nearest-neighbor distance may indicate local support, but confidence also depends on class agreement, sampling density, noise, calibration, and whether the query resembles training data in a meaningful representation. Distances from different datasets or preprocessing pipelines are not automatically comparable.
Which metric works best in high dimensions?
There is no universal winner. Cosine similarity is often effective for sparse directional data, and lower-order Minkowski distances sometimes show more contrast than higher-order alternatives, but representation quality dominates. Evaluate on the downstream task, reduce irrelevant dimensions, and inspect whether nearest neighbors are stable and meaningful.
Can I learn a distance metric from data?
Yes. Metric-learning methods learn transformations or similarity functions so that related examples move closer and unrelated examples move farther apart. Siamese networks, contrastive losses, triplet losses, and learned Mahalanobis transformations are examples. Learned metrics can capture task-specific structure, but they inherit biases and coverage limitations from their training pairs.
What is the difference between normalization and standardization?
Terminology varies, but normalization often means scaling each vector to unit length or mapping feature ranges to a fixed interval. Standardization usually means centering a feature and dividing by its standard deviation. Unit-vector normalization changes magnitudes while preserving directions; feature standardization changes the coordinate system itself.
Where to go next
Vector norms connect geometry, optimization, and statistical modeling. A strong next step is linear algebra: vectors, dot products, projections, matrices, eigenvectors, and positive-definite quadratic forms explain why Euclidean, cosine, and Mahalanobis measures behave as they do. Linear algebra also clarifies how dimensionality reduction transforms a space before distances are calculated.
Then study the full k-means article to see one particular geometry turned into an optimization algorithm. Pay close attention to the squared Euclidean objective, the arithmetic-mean update, initialization, scaling, and cluster-shape assumptions. Together, linear algebra and k-means show the central lesson of this guide in action: an AI system does not merely find similarity. It computes similarity according to choices encoded in its features, transformations, norms, and objectives.
Continue reading
Linear Algebra for Machine Learning: Vectors, Matrices, and Transformations
The core linear algebra used in AI: vectors, matrix multiplication, rank, projections, eigenvalues, and why neural networks are mostly matrix multiplies.
K-Means Clustering Explained: Centroids, Elbow Method, and When It Fails
A complete unsupervised-learning walkthrough of k-means: initialization, assignment and update steps, choosing k, silhouette scores, and density-based alternatives.
K-Nearest Neighbors Explained: Distance Metrics, Choosing K, and Classification
A practical k-NN guide covering Euclidean and Manhattan distance, majority vote, k selection, scaling, and the curse of dimensionality.