You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let m_a = if x_b != y_b { (y_a - y_b) as f64 } else { -1.0 };
957
+
let m_b = (x_b - x_a) as f64;
958
+
959
+
let (x_m, y_m) = ((x_b + x_a) as f64 / 2.0, (y_b + y_a) as f64 / 2.0);
960
+
// slope form y=mx+b
961
+
// m_og = (y_m - y_n / x_m - x_n)
962
+
// m_og * m = -1 => m = (x_n - x_m) / (y_m - y_n) = m_b / m_a
963
+
//
964
+
// y = mx+b => y_m = m*x_m + b => b = y_m - m * x_m
965
+
//
966
+
// slope form y=mx+b -> implicit form αx+βy=γ
967
+
// y = m*x + y_m - m* x_m
968
+
(
969
+
m_b as i64,
970
+
-m_a as i64,
971
+
(((y_m * m_a) - (m_b * x_m)) as i64),
972
+
)
973
+
}
974
+
\end{minted}
924
975
\chapter{Angle sectioning}
925
976
\section{Bisection}\index{angle!bisectioning}
926
977
\todo[inline]{Add \emph{angle bisectioning}}
@@ -942,7 +993,7 @@ \chapter{Drawing a line segment from its two endpoints}
942
993
\input{figures/fig2.pdf_tex}
943
994
\end{figure}
944
995
945
-
The algorithm presented here was first derived by Bresenham.In the \emph{Image} implementation, it is used in the \texttt{plot\_line\_width} method.
996
+
The algorithm presented here was first derived by Bresenham.\cite{bresenham1996}In the \emph{Image} implementation, it is used in the \texttt{plot\_line\_width} method.
\par{\noindent{}In \emph{concave} shapes you cannot draw a \textcolor{venetianred}{line segment connecting any two of its points without going outside the shape}. In \emph{convex} shapes you can.}
{\par\scriptsize{}\textbf{Parts of a circle}. Figures reproduced from \emph{K. Morling - GEOMETRIC and ENGINEERING DRAWING, second edition, 1974}}
1144
1199
\end{figure}
1145
1200
\section{Equations of a circle and an ellipse}\label{sec:equations-circles}
@@ -1210,25 +1265,72 @@ \subsection{Construction with given center and radius/radiii.}
1210
1265
}
1211
1266
}
1212
1267
\end{minted}
1268
+
%
1269
+
%
1213
1270
\subsection{Circle from three given points}\index{circle!out of three points}
1214
-
The naive way: Calculate the lines defined by the line segments created by taking a point and one of each of the rest. The order and pairings don't matter. The intersection point of their perpendiculars that pass through the middle of those line segments is the circle's center.
The naïve way: Calculate the lines defined by the line segments created by taking a point and one of each of the rest. The order and pairings don't matter. The intersection point of their perpendiculars that pass through the middle of those line segments is the circle's center.
1276
+
1277
+
\noindent{}Find perpendicular bisector of line segment: See \emph{\nameref{sec:perp-bisector}} page \pageref{sec:perp-bisector}
1278
+
1279
+
\noindent{}Find intersection point of lines: See \emph{\nameref{ch:intersection-lines}} page \pageref{ch:intersection-lines}
\subsection{Circle inscribed in given polygon (e.g. a triangle) as list of vertices}
1216
1306
Bisect any two angles and take the intersection point of the bisecting lines. This point, called the
1217
1307
\emph{incentre} is the centre of the circle and the distance of the centre from the line defined by any side is the radius.
1308
+
%
1309
+
%
1218
1310
\subsection{Circumscribed circle of given regular polygon (e.g. a triangle) as list of vertices}
1219
1311
Just like with three points, take the perpendicular lines through the middle point of any of two sides. Their intersection point, called the \emph{circumcentre} is the center of the circumscribed circle. The radius is the distance of the centre from any vertice.
1312
+
%
1313
+
%
1220
1314
\subsection{Circle that passes through given point $Α$ and point $Β$ on line $L$}
1221
1315
\todo[inline]{Add \emph{Circle that passes through given point $Α$ and point $Β$ on line $L$}}
1222
1316
\skelpar%
1317
+
%
1318
+
%
1223
1319
\subsection{Tangent line of given circle}
1224
1320
\todo[inline]{Add \emph{Tangent line of given circle}}
1225
1321
\skelpar%
1322
+
%
1323
+
%
1226
1324
\subsection{Tangent line of given circle that passes through point $P$}
1227
1325
\todo[inline]{Add \emph{Tangent line of given circle that passes through point $P$}}
1228
1326
\skelpar%
1327
+
%
1328
+
%
1229
1329
\subsection{Tangent line common to two given circles}
1230
1330
\todo[inline]{Add \emph{Tangent line common to two given circles}}
0 commit comments