-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlengthRatio.m
36 lines (32 loc) · 886 Bytes
/
lengthRatio.m
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
35
function [ ratio ] = lengthRatio( points )
% LENGTHRATIO Length ratio of three 1D points
%
% ## Syntax
% ratio = lengthRatio( points )
%
% ## Description
% ratio = lengthRatio( points )
% Returns the length ratio of the three points.
%
% ## Input Arguments
%
% points -- Points on the affine line
% A 3-vector, where `points(i)` contains the coordinate of the i-th 1D point.
%
% ## Output Arguments
%
% ratio -- Length ratio
% A scalar value equal to the length ratio of `points`.
%
% ## Notes
% - The length ratio computed by this formula will change if the order
% of the input points is reversed. (Contrast with the cross ratio of four
% points.)
%
% See also crossRatio
% Bernard Llanos
% Supervised by Dr. Y.H. Yang
% University of Alberta, Department of Computing Science
% File created March 29, 2017
ratio = (points(2) - points(1)) / (points(3) - points(2));
end