Distance and Angle in Lambertian Optical Link
Let’s break this step by step and understand the math behind these lines. This is from optical wireless communication, specifically calculating distances and angles for a Lambertian LED-to-photodetector link.
1. Distance from the LED to a point on the receiver plane
The MATLAB line:
D1 = sqrt((XR - XT(1,1)).^2 + (YR - YT(1,1)).^2 + h^2);
What it means mathematically:
- (XT(1,1), YT(1,1)) → x, y coordinates of LED #1 on the transmitter plane.
- (XR, YR) → x, y coordinates of points on the receiver plane.
- h → vertical distance between the LED plane and the receiver plane (height).
We are computing the 3D Euclidean distance from the LED to each point on the receiver plane:
\[ D_1 = \sqrt{ (X_R - X_T)^2 + (Y_R - Y_T)^2 + h^2 } \]
This is just the standard 3D distance formula:
\[ \text{distance} = \sqrt{(\Delta x)^2 + (\Delta y)^2 + (\Delta z)^2} \]
- \(\Delta x = X_R - X_T\)
- \(\Delta y = Y_R - Y_T\)
- \(\Delta z = h\) (vertical separation)
So D1 is a vector containing the distances from LED #1 to all receiver points.
2. Cosine of the angle between LED axis and receiver
The MATLAB line:
cosphi_A1 = h ./ D1;
This computes the cosine of the angle (\(\phi\)) between the LED’s normal (pointing down) and the line connecting LED to each receiver point.
Mathematically:
\[ \cos(\phi) = \frac{\text{adjacent side}}{\text{hypotenuse}} = \frac{h}{D_1} \]
- h → adjacent side (vertical distance between LED and receiver plane)
- D1 → hypotenuse (distance from LED to receiver point)
Visualized as a right triangle:
LED
*
|\
| \
| \ D1
| \
|φ \
| \
*------- Receiver plane (XR,YR)
So cosphi_A1 gives the
angle factor for Lambertian emission,
since the Lambertian model multiplies intensity by \(\cos^m(\phi)\).
Summary
D1→ 3D distance from LED to each point on the receiver plane.cosphi_A1→ cosine of the incidence angle between LED normal and receiver, used for calculating received power in Lambertian emission.
In formula terms:
\[ D_1 = \sqrt{ (X_R - X_T)^2 + (Y_R - Y_T)^2 + h^2 }, \quad \cos\phi = \frac{h}{D_1} \]
This is the core geometry behind free-space optical channel models.