Skip to content

Commit

Permalink
Use relative links in README
Browse files Browse the repository at this point in the history
  • Loading branch information
JorgWoehl committed May 6, 2021
1 parent cb43443 commit 061af50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ line([0 0], [0 0], [-20*zppt 20*zppt]);
```
This creates three 40 point long lines in the center of a 3D plot.

![example-image](https://github.com/JorgWoehl/points2axes/blob/main/assets/example.png)
![example-image](./assets/example.png)

## Requirements

**points2axes** has been tested on MATLAB R2018a and R2021a.
**points2axes** is compatible with MATLAB R2018a and later releases.

## Feedback

Expand Down
34 changes: 17 additions & 17 deletions points2axes.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
% [XPPT, YPPT, ZPPT] = POINTS2AXES(AX) calculates the conversion factors
% for the axes specified by AX instead of the current axes.
%
% The conversion factors are useful for drawing objects whose
% characteristic dimensions such as width, length, height, diameter, etc.
% are best expressed in points. Note that changing the size of the figure
% window or the limits, orientation, or aspect ratio of the axes directly
% affects the conversion factors. It is therefore recommended to set the
% axis limits before calling POINTS2AXES to prevent them from changing
% when new objects are added.
% The conversion factors are useful for drawing objects whose dimensions
% such as width, length, height, diameter, etc. are best expressed in
% points. Note that changing the size of the figure window or the limits,
% orientation, or aspect ratio of the axes directly affects the
% conversion factors. It is therefore recommended to freeze the axis
% limits before calling POINTS2AXES to prevent them from changing when
% new objects are added.
%
% Conversion factors can only be calculated if the (default)
% stretch-to-fill feature of the axes is disabled, which can be done by
% setting DASPECT, for example.
% stretch-to-fill” behavior is disabled, which can be done by setting
% DASPECT, for example.
%
% Logarithmic plots of any kind are not supported.
%
% The conversion factors for perspective projections are
% position-dependent and therefore do not have unique values. In this
% case, the conversion factors for the corresponding orthographic
% projection are returned, which gives sensible results in most cases,
% and a warning is issued.
% The conversion factors for perspective projections are position-
% dependent and therefore do not have unique values. In this case, a
% warning is issued and the conversion factors for the corresponding
% orthographic projection are returned, which gives sensible results in
% most cases.
%
%Example:
%
Expand Down Expand Up @@ -59,7 +59,7 @@
'This function accepts only one input; other inputs are ignored.');
end

% Projection
% projection
if strcmp(ax.Projection, 'perspective')
% perspective projection
warning('points2axes:Projection',...
Expand All @@ -79,7 +79,7 @@
% data aspect ratio and camera-up vector
d = ax.DataAspectRatio;
camUp = ax.CameraUpVector;
% edges of the axes "box" plus camera-up vector, expressed in equal length "units"
% edges of the axes box plus camera-up vector, expressed in equal length units
x = [0 xRange xRange 0 0 xRange xRange 0 camUp(1)] / d(1);
y = [0 0 yRange yRange 0 0 yRange yRange camUp(2)] / d(2);
z = [0 0 0 0 zRange zRange zRange zRange camUp(3)] / d(3);
Expand All @@ -91,7 +91,7 @@
% create column vectors (x,y,z)
v = [x; y; z];

% projection matrix (orthographic projection)
% projection matrix for orthographic projection
az = ax.View(1);
el = ax.View(2);
A = [cosd(az), sind(az), 0; ...
Expand Down

0 comments on commit 061af50

Please sign in to comment.