Sorry! No image available at the moment.
MELWYN - FRANCIS - CARLO
Date of Birth : 30 September, 1996 (24 years)
Location : Mumbai, MH, India   ðŸ‡®ðŸ‡³
Competitive Exams : GRE      [ Score : 321/340 ]
Human Languages : English, Konkani, Hindi, Marathi,
French & German
Fictional Languages : Wizadry Spells in Latin & Klingon
Computing Languages : C, C++, Bash (Shell), Fortran, Java, JavaScript (JS), Python, Matlab,
Scilab, HTML, CSS, PHP, ADA,
Assembly Code & Machine Code
 

The following are my favourite software:
Software name Purpose
Gedit Note-taking and developing (all programming languages).
Typora Diary writing, using rich-text markdown.
Lilypond and Frescobaldi Composing music, and compiling it into PDF and MIDI formats.
LibreOffice LibreWriter, LibreCalc, LibreImpress, and LibreBase as substitutes for MS-Word, MS-Excel, and MS-PowerPoint, and MS-Access respectively; LibreDraw for developing custom SVG images.
Audacity Audio editing.
Kdenlive Video creation and editing.
FreeCAD Designing 3D solid models.
Scilab and XCos Substitutes for MATLAB AND Simulink, respectively.
Freeplane Drawing mind-maps for brainstorming and planning purposes.
Eclipse Papyrus and Plant UML UML and SysML Diagrams
Diagrams.net (formerly draw.io) and Dia Flowcharts and block diagrams.
Android SDK Develop Android mobile phone applications, using Kotlin.
OpenJDK Compile and execute Java code.
Gnome Glade/ Gluon SceneBuilder GUI desktop applications development. Glade is for Linux apps, written in C, using the GTK3 library. SceneBuilder is for cross-platform apps, written in Java, using the JavaFX library.
Apache Superset/ Tableau Business Intelligence (BI), Data Exploration and Data Visualisation.
.col
.col

  âŒ„   

Bi-Conic Sections Intersection Solver
Algebraic Geometry Computational Geometry C++

# 1

I took the initiative to solve the intersection problem to resolve the LibreCAD issue #1459, titled 'Elipse center with 3 points causes freeze when choosing second point' . Looking into the source code, I came upon an unknown author's TODO comment with regards to another LibreCAD issue #484, titled 'Circles, the "Snap Intersection" does not work for large coordinates' . The comment basically stresses the need for an improved conics intersection solver. This would make redundant other specific solvers for calculating intersections between (any two of) circles, ellipses, arcs, etc.

The problem was that the solution would fail in certain cases, which happens because the quartic solver returns no solutions, implying that the solutions lie in the complex plane. By means of simple observation, it could easily be verified that such an inference is patently incorrect. The problem, by my deduction, was due to incorrect (or incomplete) conversion of two conic equations into a single, univariate quartic equation.

Furthermore, I did not think about this earlier, but it turns out that this concept can also be applied in the field of space dynamics to estimate where two astronomical bodies or satellites (in their respective trajectories (or orbits)), would (or could) eventually meet.
Two dimensional (2D) conic sections are contours generated as a result of a three dimensional (3D) cone and a two dimensional (2D) plane intersecting each other. Conic sections are co-planar on the intersecting plane. Specific conic sections include ellipses, circles (specific case of ellipses), parabolas, and hyperbolas.

The equation for a generic conic section is as follows :   \(C = ax^2 + bxy + cy^2 + dx + ey + f = 0\)

The intersection points of any two given conic sections are obtained by solving their simultaneous equations :
(Note that the term \(e\) is an arbitrary coefficient, and not Euler's number.)
\[C_1 = a_1x^2 + b_1xy + c_1y^2 + d_1x + e_1y + f_1 = 0\] \[C_2 = a_2x^2 + b_2xy + c_2y^2 + d_2x + e_2y + f_2 = 0\]
Let us consider two ellipses (just for the purpose of understanding intersections; the solution to the above generic problem will remain generic).
The six possible cases of solutions are as follows.

Sr. No. Case Illustration
1. No intersection
2.A. One intersection
2.B. One intersection
3. Two intersections
4. Three intersections
5. Four intersections
6. Infinite intersections
(Coincidental)


To begin solving, let us first create re-arranged forms of the above equations ( by setting aside the \(y^2\) term ) : \[Y_1^2 = y^2 = {{-a_1x^2 - b_1xy - d_1x - e_1y - f_1} \over {c_1}} = -{{a_1x^2 + b_1xy + d_1x + e_1y + f_1} \over {c_1}}\] \[Y_2^2 = y^2 = {{-a_2x^2 - b_2xy - d_2x - e_2y - f_2} \over {c_2}} = -{{a_2x^2 + b_2xy + d_2x + e_2y + f_2} \over {c_2}}\]
Clearing the fractions, and then simplifying, \[c_2(a_1x^2 + b_1xy + d_1x + e_1y + f_1) = c_1(a_2x^2 + b_2xy + d_2x + e_2y + f_2)\] \[a_1c_2x^2 + b_1c_2xy + c_2d_1x + c_2e_1y + c_2f_1) = a_2c_1x^2 + b_2c_1xy + c_1d_2x + c_1e_2y + c_1f_2\]
Transposing all RHS terms to LHS, and then factoring,   \[(a_1c_2 - a_2c_1)x^2 + (b_1c_2 - b_2c_1)xy + (d_1c_2 - d_2c_1)x + (e_1c_2 - e_2c_1)y + (f_1c_2 - f_2c_1) = 0\]
Rearranging to solve for \(y\),   \[y = {{-(a_1c_2 - a_2c_1)x^2 - (d_1c_2 - d_2c_1)x - (f_1c_2 - f_2c_1)} \over {(b_1c_2 - b_2c_1)x + (e_1c_2 - e_2c_1)}} = -{{(a_1c_2 - a_2c_1)x^2 + (d_1c_2 - d_2c_1)x + (f_1c_2 - f_2c_1)} \over {(b_1c_2 - b_2c_1)x + (e_1c_2 - e_2c_1)}}\]
Simplifying the terms, \[y = {{y_{numerator}} \over {y_{denominator}}} = {{y_n} \over {y_d}} = {{a_2c_1x^2 - a_1c_2x^2 + d_2c_1x - d_1c_2x + f_2c_1 - f_1c_2} \over {b_1c_2x - b_2c_1x + e_1c_2 - e_2c_1}}\] \[y^2 = {{y_n^2} \over {y_d^2}}\]
Upon simplifying the squares, and then factoring, we get the following equations.

\[\eqalign{y_n^2 &= (a_1^2c_2^2 + a_2^2c_1^2 - 2a_1a_2c_1c_2) \space x^4 \cr &+ (2a_1c_2^2d_1 + 2a_2c_1^2d_2 - 2a_1c_1c_2d_2 - 2a_2c_1c_2d_1) \space x^3 \cr &+ (2a_1c_2^2f_1 + 2a_2c_1^2f_2 + c_1^2d_2^2 + c_2^2d_1^2 - 2a_1c_1c_2f_2 - 2a_2c_1c_2f_1 - 2c_1c_2d_1d_2) \space x^2 \cr &+ (2c_1^2d_2f_2 + 2c_2^2d_1f_1 - 2c_1c_2d_1f_2 - 2c_1c_2d_2f_1) \space x \cr &+ (c_1^2f_2^2 + c_2^2f_1^2 - 2c_1c_2f_1f_2)}\]
\[\eqalign{y_d^2 &= (b_1^2c_2^2 + b_2^2c_1^2 - 2b_1b_2c_1c_2) \space x^2 \cr &+ (2b_1c_2^2e_1 + 2b_2c_1^2e_2 - 2b_1c_1c_2e_2 - 2b_2c_1c_2e_1) \space x \cr &+ (c_1^2e_2^2 + c_2^2e_1^2 - 2c_1c_2e_1e_2)}\]
Substituting the \(y_n\) and \(y_d\) terms into one of the conic sections, say, \(C_1\), we get the following equation. \[C_1 = a_1x^2 + b_1x{{y_n} \over {y_d}} + c_1{{y_n^2} \over {y_d^2}} + d_1x + e_1{{y_n} \over {y_d}} + f_1 = 0\]
Upon clearing the fractions, we get the following equation. \[C_1 = a_1x^2y_d^2 + b_1xy_ny_d + c_1y_n^2 + d_1xy_d^2 + e_1y_ny_d + f_1y_d^2 = 0\]
Upon factoring, we get the following equation. \[C_1 = c_1y_n^2 + (b_1x + e_1)y_ny_d + (a_1x^2 + d_1x + f_1)y_d^2 = 0\]
Upon expanding the \(y_n\) and \(y_d\) terms, we get the following equation. \[\eqalign{C_1 &= (a_1^2c_1c_2^2 + a_2^2c_1^3 - 2a_1a_2c_1^2c_2) \space x^4 \cr &+ (2a_1c_1c_2^2d_1 + 2a_2c_1^3d_2 - 2a_1c_1^2c_2d_2 - 2a_2c_1^2c_2d_1) \space x^3 \cr &+ (2a_1c_1c_2^2f_1 + 2a_2c_1^3f_2 + c_1^3d_2^2 + c_1c_2^2d_1^2 - 2a_1c_1^2c_2f_2 - 2a_2c_1^2c_2f_1 - 2c_1^2c_2d_1d_2) \space x^2 \cr &+ (2c_1^3d_2f_2 + 2c_1c_2^2d_1f_1 - 2c_1^2c_2d_1f_2 - 2c_1^2c_2d_2f_1) \space x \cr &+ (c_1c_2^2f_1^2 + c_1^3f_2^2 - 2c_1^2c_2f_1f_2) \cr \cr &+ (a_1b_1b_2c_1c_2 + a_2b_1^2c_1c_2 - a_1b_1^2c_2^2 - a_2b_1b_2c_1^2) \space x^4 \cr &+ (a_1b_1c_1c_2e_2 + a_1b_2c_1c_2e_1 + 2a_2b_1c_1c_2e_1 + b_1^2c_1c_2d_2 + b_1b_2c_1c_2d_1 - 2a_1b_1c_2^2e_1 - a_2b_1c_1^2e_2 - a_2b_2c_1^2e_1 - b_1^2c_2^2d_1 - b_1b_2c_1^2d_2) \space x^3 \cr &+ (a_1c_1c_2e_1e_2 + a_2c_1c_2e_1^2 + b_1b_2c_1c_2f_1 + b_1c_1c_2d_1e_2 + 2b_1c_1c_2d_2e_1 + b_1^2c_1c_2f_2 + b_2c_1c_2d_1e_1 \cr & \space \space \space \space \space \space \space \space \space \space \space \space - a_1c_2^2e_1^2 - a_2c_1^2e_1e_2 - b_1b_2c_1^2f_2 - b_1c_1^2d_2e_2 - 2b_1c_2^2d_1e_1 - b_1^2c_2^2f_1 - b_2c_1^2d_2e_1) \space x^2 \cr &+ (2b_1c_1c_2e_1f_2 + b_1c_1c_2e_2f_1 + b_2c_1c_2e_1f_1 + c_1c_2d_1e_1e_2 + c_1c_2d_2e_1^2 - b_1c_1^2e_2f_2 - 2b_1c_2^2e_1f_1 - b_2c_1^2e_1f_2 - c_1^2d_2e_1e_2 - c_2^2d_1e_1^2) \space x \cr &+ (c_1c_2e_1^2f_2 + c_1c_2e_1e_2f_1 - c_1^2e_1e_2f_2 - c_2^2e_1^2f_1) \cr \cr &+ (a_1b_1^2c_2^2 + a_1b_2^2c_1^2 - 2a_1b_1b_2c_1c_2) \space x^4 \cr &+ (2a_1b_1c_2^2e_1 + 2a_1b_2c_1^2e_2 + b_1^2c_2^2d_1 + b_2^2c_1^2d_1 - 2a_1b_1c_1c_2e_2 - 2a_1b_2c_1c_2e_1 - 2b_1b_2c_1c_2d_1) \space x^3 \cr &+ (a_1c_1^2e_2^2 + a_1c_2^2e_1^2 + b_1^2c_2^2f_1 + b_2^2c_1^2f_1 + 2b_1c_2^2d_1e_1 + 2b_2c_1^2d_1e_2 - 2a_1c_1c_2e_1e_2 - 2b_1b_2c_1c_2f_1 - 2b_1c_1c_2d_1e_2 - 2b_2c_1c_2d_1e_1) \space x^2 \cr &+ (c_1^2d_1e_2^2 + c_2^2d_1e_1^2 + 2b_1c_2^2e_1f_1 + 2b_2c_1^2e_2f_1 - 2b_1c_1c_2e_2f_1 - 2b_2c_1c_2e_1f_1 - 2c_1c_2d_1e_1e_2) \space x \cr &+ (c_1^2e_2^2f_1 + c_2^2e_1^2f_1 - 2c_1c_2e_1e_2f_1) \cr \cr &= 0}\]
Upon factoring the \(x^n\) terms, we get the following equation of the form \(Ax^4 + Bx^3 + Cx^2 + Dx + K = 0\),
where \(A, B, C,\) and \(D\) are coefficients, and \(K\) is a constant. \[\eqalign{& \space (a_1^2c_1c_2^2 + a_2^2c_1^3 - 2a_1a_2c_1^2c_2 + a_2b_1^2c_1c_2 - a_2b_1b_2c_1^2 + a_1b_2^2c_1^2 - a_1b_1b_2c_1c_2) \space x^4 \cr \cr &+ (2a_1c_1c_2^2d_1 + 2a_2c_1^3d_2 - 2a_1c_1^2c_2d_2 - 2a_2c_1^2c_2d_1 \cr & \space \space \space \space \space + 2a_2b_1c_1c_2e_1 + b_1^2c_1c_2d_2 - a_2b_1c_1^2e_2 - a_2b_2c_1^2e_1 - b_1b_2c_1^2d_2 \cr & \space \space \space \space \space + 2a_1b_2c_1^2e_2 + b_2^2c_1^2d_1 - a_1b_1c_1c_2e_2 - a_1b_2c_1c_2e_1 - b_1b_2c_1c_2d_1) \space x^3 \cr \cr &+ (2a_1c_1c_2^2f_1 + 2a_2c_1^3f_2 + c_1^3d_2^2 + c_1c_2^2d_1^2 - 2a_1c_1^2c_2f_2 - 2a_2c_1^2c_2f_1 - 2c_1^2c_2d_1d_2 \cr & \space \space \space \space \space + a_2c_1c_2e_1^2 + 2b_1c_1c_2d_2e_1 + b_1^2c_1c_2f_2 - a_2c_1^2e_1e_2 - b_1b_2c_1^2f_2 - b_1c_1^2d_2e_2 - b_2c_1^2d_2e_1 \cr & \space \space \space \space \space + a_1c_1^2e_2^2 + b_2^2c_1^2f_1 + 2b_2c_1^2d_1e_2 - a_1c_1c_2e_1e_2 - b_1b_2c_1c_2f_1 - b_1c_1c_2d_1e_2 - b_2c_1c_2d_1e_1) \space x^2 \cr \cr &+ (2c_1^3d_2f_2 + 2c_1c_2^2d_1f_1 - 2c_1^2c_2d_1f_2 - 2c_1^2c_2d_2f_1 \cr & \space \space \space \space \space + 2b_1c_1c_2e_1f_2 + c_1c_2d_2e_1^2 - b_1c_1^2e_2f_2 - b_2c_1^2e_1f_2 - c_1^2d_2e_1e_2 \cr & \space \space \space \space \space + c_1^2d_1e_2^2 + 2b_2c_1^2e_2f_1 - b_1c_1c_2e_2f_1 - b_2c_1c_2e_1f_1 - c_1c_2d_1e_1e_2) \space x \cr \cr &+ (c_1c_2^2f_1^2 + c_1^3f_2^2 - 2c_1^2c_2f_1f_2 + c_1c_2e_1^2f_2 - c_1^2e_1e_2f_2 + c_1^2e_2^2f_1 - c_1c_2e_1e_2f_1) \cr \cr &= 0}\]
This is a quartic (fourth degree) equation. The intersection abscissae (x-coordinates) are the characteristic roots of this equation. A quartic equation may be solved using several methods, though the methods are categorised as either analytic or iterative. Popular examples in the two categories are the 'Ferrari's method' and the 'Newton–Raphson method' .

Care has to be taken to ensure that only solutions in the Real Domain \(( f(x) \in {\mathbb{R}} )\) are stored, and solution in the Complex Domain \(( f(x) \in {\mathbb{C}} )\) are discarded/ignored. Also, care has to be taken to ensure that there is sufficient precision while performing mathematical operations. Relying on float and double for precision-based applications is a folly.

Visit its Source !

  âŒ„   

System of Bi-Linear Simultaneous Equations Solver
Algebraic Geometry

# 2

Consider the following two generic linear equations in two variables: \[a_1x + b_1y + c_1 = 0\] \[a_2x + b_2y + c_2 = 0\] Re-arranging to solve for the \(y\) term in the second equation, we get \[y = {{-a_2x - c_2} \over {b_2}} = -{{a_2x + c_2} \over {b_2}}\] Substituting the second equation's \(y\) term in the first equation, we get \[\bbox[10px, border: 2px solid black]{x = {{b_1c_2 - b_2c_1} \over {a_1b_2 - a_2b_1}}}\] Similarly, re-arranging to solve for the \(x\) term in the second equation, we get \[y = {{-a_2x - c_2} \over {b_2}} = -{{a_2x + c_2} \over {b_2}}\] And then, substituting the second equation's \(x\) term in the first equation, we get \[\bbox[10px, border: 2px solid black]{y = {{a_1c_2 - a_2c_1} \over {a_2b_1 - a_1b_2}}}\] Subject to the following conditions:
  • \((a_1 \neq 0) \land (a_2 \neq 0)\)
  • \((b_1 \neq 0) \land (b_2 \neq 0)\)
  • \((a_1b_2 \neq a_2b_1)\)

  âŒ„   

System of Tri-Linear Simultaneous Equations Solver
Algebraic Geometry

# 3

Consider the following three generic linear equations in three variables: \[a_1x + b_1y + c_1z + d_1 = 0\] \[a_2x + b_2y + c_2z + d_2 = 0\] \[a_3x + b_3y + c_3z + d_3 = 0\] Using Cramer's rule, \[x = \frac {D_x}{D}\] \[y = \frac {D_y}{D}\] \[z = \frac {D_z}{D}\] Subject to the following condition:
  • \(D \neq 0\)

The \(D\) terms are determinants, and they are defined as follows. \[\eqalign{ D &= \begin{vmatrix} a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \\ a_3 & b_3 & c_3 \end{vmatrix} \cr &= a_1(b_2c_3 - b_3c_2) - b_1(a_2c_3 - a_3c_2) + c_1(a_2b_3 - a_3b_2) \cr &= a_1b_2c_3 - a_1b_3c_2 - a_2b_1c_3 + a_3b_1c_2 + a_2b_3c_1 - a_3b_2c_1 \cr \cr D_x &= \begin{vmatrix} -d_1 & b_1 & c_1 \\ -d_2 & b_2 & c_2 \\ -d_3 & b_3 & c_3 \end{vmatrix} \cr &= -d_1(b_2c_3 - b_3c_2) - b_1(-c_3d_2 + c_2d_3) + c_1(-b_3d_2 + b_2d_3) \cr &= b_1c_3d_2 - b_1c_2d_3 + b_2c_1d_3 - b_2c_3d_1 + b_3c_2d_1 - b_3c_1d_2 \cr \cr D_y &= \begin{vmatrix} a_1 & -d_1 & c_1 \\ a_2 & -d_2 & c_2 \\ a_3 & -d_3 & c_3 \end{vmatrix} \cr &= a_1(-c_3d_2 + c_2d_3) + d_1(a_2c_3 - a_3c_2) + c_1(-a_2d_3 + a_3d_2) \cr &= a_1c_2d_3 - a_1c_3d_2 + a_2c_3d_1 - a_2c_1d_3 + a_3c_1d_2 - a_3c_2d_1 \cr \cr D_z &= \begin{vmatrix} a_1 & b_1 & -d_1 \\ a_2 & b_2 & -d_2 \\ a_3 & b_3 & -d_3 \end{vmatrix} \cr &= a_1(-b_2d_3 + b_3d_2) - b_1(-a_2d_3 + a_3d_2) - d_1(a_2b_3 - a_3b_2) \cr &= a_1b_3d_2 - a_1b_2d_3 + a_2b_1d_3 - a_2b_3d_1 + a_3b_2d_1 - a_3b_1d_2 }\]
Subject to the following conditions:
  • \(D_{i, *} \neq 0\)
  • \(D_{*, j} \neq 0\)
  • \(D_{1, *} \neq D_{2, *}\)
  • \(D_{1, *} \neq D_{3, *}\)
  • \(D_{2, *} \neq D_{3, *}\)
  • \(D_{*, 1} \neq D_{*, 2}\)
  • \(D_{*, 1} \neq D_{*, 3}\)
  • \(D_{*, 2} \neq D_{*, 3}\)

  âŒ„   

Equating a Transformable Rectangle
Algebraic Geometry

# 4

Consider equations of the following form (where \(c\) is an arbitrary constant): \[\bbox[10px, border: 2px solid black]{x^k + y^k = c^k}\]

             

FIGURE: \( \space \space k = 1 \space \space \) produces a line.
   

FIGURE: \( \space \space k = 2 \space \space \) produces a circle.



FIGURE: \( \space \space k = \frac{2}{3} = 0.\dot{6} \approx 0.6667 \space \space \)
produces an   astroid.

FIGURE: \( \space \space k \to \infty \space \space \)
produces a square.



NOTE that, with respect to the local origin:
  • \(0 < k < 1\) produces a concave curve
  • \(k > 1 \qquad \) produces a convex curve

For a rectangle (which is a generic form of a square), or a square (which is a specific form of a rectangle), the resolution of its corners is proportional to the \(k\) value. In the above image, \(k = 1000\) was used; \(k = 100\) leads to slightly rounded corners.

Adding horizontal and vertical translations, \(t_x\) and \(t_y\), respectively, modifies the aforementioned equation as follows. \[\bbox[10px, border: 2px solid black]{(x - t_x)^k + (y - t_y)^k = c^k}\] Positive values translate in the rightward and upward directions, respectively, and negative values translate in the leftward and downward directions, respectively. Next, adding horizontal and vertical scale factors, \(s_x\) and \(s_y\), respectively, modifies the equation independently as follows. \[\bbox[10px, border: 2px solid black]{ \left( \frac {x}{s_x} \right) ^k + \left( \frac {y}{s_y} \right) ^k = c^k}\] The scale factors vary proportionally to the required scaling, in either direction. NOTE that, the arbitrary constant, \(c\), can also act as a scale factor that also varies proportionally to the required scaling; however, it scales equally in the horizontal and vertical axes. So, setting \(s_x = f\) and \(s_y = f\) is the same as setting \(c = f\), where \(f\) is an arbitrary scale factor. Finally, adding rotation, \(\theta\), by applying the two-dimensional rotation matrix, modifies the equation independently as follows. \[\bbox[10px, border: 2px solid black]{(x \cdot cos(\theta) - y \cdot sin(\theta))^k + (x \cdot sin(\theta) + y \cdot cos(\theta))^k = c^k}\]
In the above equation, the angle, \(\theta\), is in the clockwise direction; for counter-clockwise (anti-clockwise) rotation, simply negate the angle, \(\theta\), as \(-\theta\), thereby modifying the above equation as follows.
\[\bbox[10px, border: 2px solid black]{(x \cdot cos(\theta) + y \cdot sin(\theta))^k + (y \cdot cos(\theta) - x \cdot sin(\theta))^k = c^k}\]
Now, aggregating the above transformations into a single, all-encompassing equation, we get the following equation.

\[\bbox[10px, border: 2px solid black] { \left\{ \frac { \left[ (x - t_x) \cdot cos(\theta) \right] + \left[ (y - t_y) \cdot sin(\theta) \right] } {s_x} \right\} ^ k + \left\{ \frac { \left[ (y - t_y) \cdot cos(\theta) \right] - \left[ (x - t_x) \cdot sin(\theta) \right] } {s_y} \right\} ^ k = c^k}\]
\[\bbox[10px, border: 2px solid black] { s_y^k \cdot \left\{ \left[ (x - t_x) \cdot cos(\theta) \right] + \left[ (y - t_y) \cdot sin(\theta) \right] \right\} ^ k + s_x^k \cdot \left\{ \left[ (y - t_y) \cdot cos(\theta) \right] - \left[ (x - t_x) \cdot sin(\theta) \right] \right\} ^ k =c^{k}s_x^{k}s_y^{k}}\]
This final equation can be used to create and transform a generic rectangle. Illustrated below is a two-by-one \( (2 \times 1) \) rectangle, translated rightward and upward by two units each \( (+2, +2) \), and rotated clockwise by forty-five degrees \( \left( -45^{\circ} \space \text{or} \space -\frac{\pi}{4}^c \space \text{or} \space +\frac{7\pi}{4}^c \right) \).

\[\bbox[10px, border: 2px solid black] { \left\{ \frac { \left[ (x - 2) \cdot cos \left( - \frac{\pi}{4} \right) \right] + \left[ (y - 2) \cdot sin \left( - \frac{\pi}{4} \right) \right] } {2} \right\} ^ {100} + \left\{ \left[ (y - 2) \cdot cos \left( - \frac{\pi}{4} \right) \right] - \left[ (x - 2) \cdot sin \left( - \frac{\pi}{4} \right) \right] \right\} ^ {100} = 1}\]
\[\bbox[10px, border: 2px solid black] { \left[ \space 0.35355 (x - 2) \space - \space 0.35355 (y - 2) \space \right] ^ {100} + \left[ \space 0.7071 (x - 2) \space + \space 0.7071 (y - 2) \space \right] ^ {100} = 1}\]



The final equation can further be modified to accommodate a generic quadrilateral.

  âŒ„   

Auto-Panning the CAD Area
Computational Geometry

# 5

C (x, y) P (x, y)
In the figure above:
  • the contour of the outer (blue) rectangle represents the CAD window's drawable area.
  • the contour of the inner (grey) rectangle represents the unprobed area for the auto-pan function.
  • the blue strip area is the region where the auto-pan function is supposed to operate.
  • \(C (x, y)\) is the centre point of the CAD window's drawable area.
  • \(P (x, y)\) is an arbitrary mouse (cursor) position
  • \(P (x, y)\) is located within the perimeter of the unprobed area
  • \(P (x, y)\) is located outside the perimeter of the CAD window's drawable area
C (x, y) P (x, y) U (x, y)
In the figure above:
  • an imaginary line is drawn connecting point \(C (x, y)\) and point \(P (x, y)\).
  • Point \(U (x, y)\) is the CAD drawable area's upper-right corner.


Considering the two points \(C\) and \(P\), a right triangle can be formed, as illustrated below.
P (x, y) C (x, y) θ
The vector \(\overrightarrow{CP}\) has a magnitude, \(\lVert \overrightarrow{CP} \rVert\), and an angle, \(\theta\). \[\lVert \overrightarrow{CP} \rVert = \sqrt {(P_x - C_x)^2 + (P_y - C_y)^2}\] \[\theta = tan^{-1} \left( \frac {P_y - C_y}{P_x - C_x} \right)\]
Note that all angles follow the counter-clockwise (anti-clockwise) direction. Now, extend the vertical line in the above illustrated right triange, such that it cuts the borders of the inner and outer rectangular areas. This is illustrated below, with the term \(L\) denoting lengths.
P (x, y) C (x, y) θ LI L LO
The dimensions of the CAD window's drawable area and the unprobed area are fixed, that is, they are definitely known during a given instance of the function's operation. So, let \(W_I\) and \(W_O\) denote their respective widths, and let \(H_I\) and \(H_O\) denote their respective heights, where the subscripts \(I\) and \(O\) mean inner and outer, respectively.

Let \(\alpha\), a constant, be the CAD drawable area's quarter angle, brought about by the vector, \(\overrightarrow{CU}\). Then, \[\alpha = tan^{-1} \left( \frac {U_y - C_y}{U_x - C_x} \right)\] \[L = \begin{cases} \left| P_y - C_y \right|, & \text{if} \space \space \space \space \space \space \space \space \space \space \space \alpha \lt \theta \leqslant \pi - \alpha \\ \left| P_y - C_y \right|, & \text{if} \space \space \space \space \pi + \alpha \lt \theta \leqslant 2 \pi - \alpha \\ \left| P_x - C_x \right|, & \text{if} \space \space \space \space \pi - \alpha \lt \theta \leqslant \pi + \alpha \\ \left| P_x - C_x \right|, & \text{if} \space \space 2 \pi - \alpha \lt \theta \leqslant \alpha \end{cases}\] \[L_I = \begin{cases} \frac{H_I}{2}, & \text{if} \space \space \space \space \space \space \space \space \space \space \space \alpha \lt \theta \leqslant \pi - \alpha \\ \frac{H_I}{2}, & \text{if} \space \space \space \space \pi + \alpha \lt \theta \leqslant 2 \pi - \alpha \\ \frac{W_I}{2}, & \text{if} \space \space \space \space \pi - \alpha \lt \theta \leqslant \pi + \alpha \\ \frac{W_I}{2}, & \text{if} \space \space 2 \pi - \alpha \lt \theta \leqslant \alpha \end{cases}\] \[L_O = \begin{cases} \frac{H_O}{2}, & \text{if} \space \space \space \space \space \space \space \space \space \space \space \alpha \lt \theta \leqslant \pi - \alpha \\ \frac{H_O}{2}, & \text{if} \space \space \space \space \pi + \alpha \lt \theta \leqslant 2 \pi - \alpha \\ \frac{W_O}{2}, & \text{if} \space \space \space \space \pi - \alpha \lt \theta \leqslant \pi + \alpha \\ \frac{W_O}{2}, & \text{if} \space \space 2 \pi - \alpha \lt \theta \leqslant \alpha \end{cases}\]
The percentage of the mouse (cursor) position with respect to it's minimum and maximum allowable points, \(I\) and \(O\), respectively,
(called the Percentage Factor, or \(PF\)) is calculated as follows. \[PF = \frac {L - L_I} {L_O - L_I}\]
The pan displacement/offset vector, in the polar coordinate system, is \((R, \theta)\), where \(R\), a constant, is the pan offset magnitude.

For auto-panning, the pan operation is periodically repeated. The interval period is inversely proportional to the required speed of the auto-pan operation. The auto-pan timer interval, \(APTI\), is calculated as follows, where \(APTI_{MIN}\) and \(APTI_{MAX}\) are its minimum and maximum constants. \[APTI = APTI_{MIN} + \left[ ( APTI_{MAX} - APTI_{MIN}) \space \cdot \space (1.0 - PF) ) \right]\]
Visit its Source !

  âŒ„   

Header Design for Linux Terminals
Bash (Shell)

# 1

Two variants of heading banners can be created on a CUI (Character User Interface) Terminal.   These headers can display any alpha-numeric or ASCII-based text.   It's position and size can also be modified.

Visit its Source !


  âŒ„   

File Explorer Dialogue for Linux Terminals
Bash (Shell)

# 2

Selecting a file(s) or folder(s) for using a simple CUI (Character User Interface) Terminal.   This is generally used for loading, opening and saving files and folders.   It can be used for other purposes too.   The next project '#3' applies this very solution to supplement its other functions.

Visit its Source !



  âŒ„   

Web Data Capture through a Linux Terminal
Bash (Shell)

# 3

This application is meant to be used for gathering text-based information from the web.   This application primarily applies to static websites. The data can be updated after a specified duration.   On unavailability of data, the stored (cached) data can be used instead, where applicable.   Furthermore, the downloaded data is stripped of its HTML tags, while removing numerical data and punctuations is optional.

Visit its Source !



  âŒ„   

Data Backup in a Linux Operating System
Bash (Shell)

# 4

This application backs up folders onto an external media device.   The data may be backed up in a compressed or uncompressed format. Provisions have been made, for advanced users, to backup at the click of a button, with settings being pre-defined by the user itself (the Lite version).   The orginal version, on the other hand, works in the interative mode.   This application also creates logs for further observation.   Furthermore, the application can be installed and uninstalled using a set of commands mentioned in the 'README' file, available at its 'Source'.

Visit its Source !






To   CONTACT   or   to seek references   for   verification of claims :
TELEPHONE : + 9 1 - 9 1 6 7 0 8 8 0 7 8 (Whatsapp Enabled)
EMAIL : melwyncarlo@gmail.com (Priority Mail)
carlo.melwyn@outlook.com (Conventional Mail)
 
SOCIAL MEDIA : LinkedIn â—„â—„     Visit Profile    â–ºâ–º
GitHub â—„â—„     Visit Profile    â–ºâ–º
StackOverflow â—„â—„     Visit Profile    â–ºâ–º
Make : Projects â—„â—„     Visit Profile    â–ºâ–º
DevianArt â—„â—„     Visit Profile    â–ºâ–º
GoodReads â—„â—„     Visit Profile    â–ºâ–º
16Personalities â—„â—„     Visit Profile    â–ºâ–º
Gentlemint â—„â—„     Visit Profile    â–ºâ–º
CLICK - HERE   to view the   'Curriculum - Vitae'
Copyright © 2021-2022 Melwyn Francis Carlo