The Matlab code can be used to create a point symmetric function with respect to a given point of symmetry.

It also shows the principle that:

The linear average of a point symmetric function is equal to its DC offset.

Corollary:

If a function f(x) is point symmetric with respect to any point on the x-axis, its linear average (as well as its integral from -infinity to +infinity) is zero.

Let’s see the code:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
Point = [2; 3]; % Point of Symmetry HowManyPoints = 10; % Number of points for left and right part Left_X = Point(1)-HowManyPoints:Point(1)-1; % default unit step Left_Y = randi(100,1,HowManyPoints); % random Y values Left = [Left_X;Left_Y]; Right = 2*Point-Left; % Point reflection formula AllPoints =[Left, Right]; % Joining left and right parts % Sorting AllPoints according to X direction for the plot function [~, sortedX] = sort(AllPoints(1,:)); AllPoints = AllPoints(:,sortedX); % Extract X and Y components X = AllPoints(1,1:end); Y = AllPoints(2,1:end); plot(X, Y); grid on; hold on; area(X,Y, 'FaceColor', 'blue'); % show area under the curve scatter(Point(1),Point(2),'filled','black'); % show point of symmetry TOTAL_AREA = trapz(X, Y); PERIOD = 2*HowManyPoints; DC_OFFSET = Point(2); t = annotation('textarrow','String',sprintf('AREA=%d\nPERIOD=%d\nOFFSET=%d\n',TOTAL_AREA, PERIOD, DC_OFFSET)); t.HorizontalAlignment = 'Left'; text(Point(1)+1,Point(2)+1, 'Point of symmetry'); |

Sample output:

As expected, the area under the curve (considering it negative when the function is negative) corresponds to the area below the linear average line (equal to the offset * period).

## Leave a Reply