# Interactive Cabrera Circle

Users can explore the heart's anatomical alignment using this visualization tool and can gain an in-depth understanding of the heart's electrical orientations by overlaying the projected cardiac vectors onto the Cabrera circle.

Click and drag on the cabrera circle to see the projected lead vectors.

## Understanding the Cabrera System

The Cabrera system or Hexaxial reference system, often referred to as the Cabrera sequence or Cabrera circle, represents a logical sequence in which electrocardiogram (ECG) leads are observed. This circle offers a bird's-eye view of the heart's electrical activity in the frontal plane.

### Historical Overview

Originating from the work of Dr. Enrique Cabrera, this system seeks to provide a more coherent representation of the heart's electrical vectors. Traditional ECG presentations often separate limb leads (Ⅰ, Ⅱ, Ⅲ) and augmented limb leads (aVL, aVR, aVF), but the Cabrera system presents them in a continuous sequence, offering a more comprehensive and intuitive understanding.

### Visualization and Importance

Visualized as a circle, the Cabrera system starts with the lead I on the horizontal plane and moves clockwise, integrating the other leads and returning to the horizontal plane. This arrangement:

- Offers a continuous transition from one lead to another.
- Presents a more holistic view of the heart's electrical activity.
- Facilitates easier recognition of the heart's electrical axis.

## The Math Behind Projections

To comprehend the projections in the Cabrera system, a dive into vector mathematics is indispensable.

### A Closer Look at Scalar Projection

Scalar projection, sometimes referred to as the "scalar component", is the length of the projection of one vector onto another. To understand this concept, we'll begin with the geometric interpretation of the dot product.

#### The Coordinate definition of the Dot Product

Given two vectors $\backslash mathbf\{a\}\; =\; [a\_1,\; \backslash ldots,\; a\_n]^T$ and $\backslash mathbf\{b\}\; =\; [b\_1,\; \backslash ldots,\; b\_n]^T$, their dot product is defined as:

$$\backslash mathbf\{a\}\; \backslash cdot\; \backslash mathbf\{b\}\; =\; \backslash sum\_\{i\; =\; n\}^\{n\}\; a\_ib\_i\; =\; a\_1b\_1\; +\; \backslash ldots\; +\; a\_nb\_n$$If $\backslash mathbf\{a\}\; =\; \backslash mathbf\{b\}$ their dot product can also be defined as:

$$\backslash mathbf\{a\}\; \backslash cdot\; \backslash mathbf\{a\}\; =\; a\_1a\_1\; +\; \backslash ldots\; +\; a\_na\_n\; =\; \backslash sqrt\{a\_1^2\; +\; \backslash ldots\; +\; a\_n^2\}^2\; =\; \backslash vert\; \backslash mathbf\{a\}\; \backslash vert^2$$#### The Geometric Interpretation of the Dot Product

In Euclidean space like the cabrera system in $\backslash mathbb\{R\}^2$ with standard dot product we can also use the geometric definition:

$$\backslash mathbf\{a\}\; \backslash cdot\; \backslash mathbf\{b\}\; =\; \backslash vert\; \backslash mathbf\{a\}\; \backslash vert\; \backslash vert\; \backslash mathbf\{b\}\; \backslash vert\; \backslash cos(\backslash theta)$$Where:

- $\backslash vert\; \backslash mathbf\{a\}\; \backslash vert$ and $\backslash vert\; \backslash mathbf\{b\}\; \backslash vert$ are the magnitudes (or lengths) of vectors $\backslash mathbf\{a\}$ and $\backslash mathbf\{b\}$ respectively.
- $\backslash theta$ is the angle between the two vectors.

The factor $\backslash cos(\backslash theta)$ is a critical component here. If we visualize this geometrically:

- Imagine vector $a$ being "projected" onto vector $b$.
- This "projection" casts a shadow or a line segment onto vector $b$.
- The length of this shadow is the scalar projection of $a$ onto $b$.

Now, recall the trigonometric definition:

$$\backslash cos(\backslash theta)\; =\; \backslash frac\{\backslash text\{adjacent\}\}\{\backslash text\{hypotenuse\}\}$$In our case:

- The "hypotenuse" is the magnitude of vector $a$, $\backslash vert\; \backslash mathbf\{a\}\; \backslash vert$.
- The "adjacent" side is the length of the shadow, i.e., the scalar projection.

So, rearranging the terms, the scalar projection of $a$ onto $b$ (often denoted as $\backslash text\{comp\}\_\backslash mathbf\{b\}(\backslash mathbf\{a\})$) is:

$$\backslash text\{comp\}\_\backslash mathbf\{b\}(\backslash mathbf\{a\})\; =\; \backslash vert\; \backslash mathbf\{a\}\; \backslash vert\; \backslash cos(\backslash theta)\; =\; \backslash frac\{\backslash mathbf\{a\}\; \backslash cdot\; \backslash mathbf\{b\}\}\{\backslash vert\; \backslash mathbf\{b\}\; \backslash vert\}$$### Basics of Vector Projection

Given our understanding of scalar projection, vector projection becomes a natural extension. Once we've found the scalar projection (or length) of one vector onto another, obtaining the vector projection is a matter of giving that length a direction.

In the context of scalar projection, the vector projection of $\backslash mathbf\{a\}$ onto $\backslash mathbf\{b\}$ is obtained by multiplying the scalar projection by the unit vector of $\backslash mathbf\{b\}$ (because the unit vector of $\backslash mathbf\{b\}$ provides the direction). Mathematically:

$$\backslash text\{proj\}\_\backslash mathbf\{b\}(\backslash mathbf\{a\})\; =\; \backslash text\{comp\}\_\backslash mathbf\{b\}(\backslash mathbf\{a\})\; \backslash times\; \backslash frac\{\backslash mathbf\{b\}\}\{\backslash vert\; \backslash mathbf\{b\}\backslash vert\; \}$$Where:

- $\backslash text\{comp\}\_\backslash mathbf\{b\}(\backslash mathbf\{a\})$ is the scalar projection of $\backslash mathbf\{a\}$ onto $\backslash mathbf\{b\}$.
- $\backslash frac\{\backslash mathbf\{b\}\}\{\backslash vert\; \backslash mathbf\{b\}\backslash vert\; \}$ is the unit vector of $\backslash mathbf\{b\}$, which provides the direction.

Expanding upon our earlier definition of scalar projection:

$$\backslash text\{comp\}\_\backslash mathbf\{b\}(\backslash mathbf\{a\})\; =\; \backslash frac\{\backslash mathbf\{a\}\; \backslash cdot\; \backslash mathbf\{b\}\}\{\backslash vert\; \backslash mathbf\{b\}\; \backslash vert\}$$Combining these two equations:

$$\backslash text\{proj\}\_\backslash mathbf\{b\}(\backslash mathbf\{a\})\; =\; \backslash frac\{\backslash mathbf\{a\}\; \backslash cdot\; \backslash mathbf\{b\}\}\{\backslash vert\; \backslash mathbf\{b\}\; \backslash vert\}\; \backslash times\; \backslash frac\{\backslash mathbf\{b\}\}\{\backslash vert\; \backslash mathbf\{b\}\backslash vert\; \}\; =\; \backslash frac\{\backslash mathbf\{a\}\; \backslash cdot\; \backslash mathbf\{b\}\}\{\backslash vert\; \backslash mathbf\{b\}\; \backslash vert^2\}\; \backslash times\; \backslash mathbf\{b\}$$Simplifying further by using the identity $\backslash vert\; \backslash mathbf\{b\}|^2\; =\; \backslash mathbf\{b\}\; \backslash cdot\; \backslash mathbf\{b\}$:

$$\backslash text\{proj\}\_\backslash mathbf\{b\}(\backslash mathbf\{a\})\; =\; \backslash frac\{\backslash mathbf\{a\}\; \backslash cdot\; \backslash mathbf\{b\}\}\{\backslash mathbf\{b\}\; \backslash cdot\; \backslash mathbf\{b\}\}\; \backslash mathbf\{b\}$$This equation gives us the vector projection of $\backslash mathbf\{a\}$ onto $\backslash mathbf\{b\}$, taking into account both magnitude (from the scalar projection) and direction (from $\backslash mathbf\{b\}$).

### Relevance to the Cabrera System

In ECG interpretation using the Cabrera system, the heart's primary vector is akin to vector $\backslash mathbf\{a\}$, and each lead acts as vector $\backslash mathbf\{b\}$. By projecting the heart's electrical activity onto each lead, we get a reading representative of the heart's activity relative to that lead's orientation.