From 5d719b6bcba7ea6addbbd6ee9727e70c6e120b30 Mon Sep 17 00:00:00 2001 From: Bryan Weber Date: Fri, 15 Mar 2024 14:48:14 -0400 Subject: [PATCH] Add script to draw the time since periapsis figure --- drawing-scripts/apse-line.ipynb | 101 +++++----- .../elliptical-orbit-definitions.ipynb | 8 +- .../time-since-periapsis-area.ipynb | 175 ++++++++++++++++++ 3 files changed, 227 insertions(+), 57 deletions(-) create mode 100644 drawing-scripts/time-since-periapsis-area.ipynb diff --git a/drawing-scripts/apse-line.ipynb b/drawing-scripts/apse-line.ipynb index 9460f969..3dd28ef6 100644 --- a/drawing-scripts/apse-line.ipynb +++ b/drawing-scripts/apse-line.ipynb @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 2, "id": "04a954fc-dc9f-4267-aa55-5ec2d6637832", "metadata": {}, "outputs": [], @@ -23,7 +23,7 @@ }, { "cell_type": "code", - "execution_count": 115, + "execution_count": 3, "id": "de90a182-c281-454e-80c3-d8e568a88740", "metadata": {}, "outputs": [ @@ -31,64 +31,59 @@ "data": { "image/svg+xml": [ "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - " \n", - " \n", - " \n", - " \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n" ], "text/plain": [] }, - "execution_count": 115, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -199,15 +194,15 @@ ], "metadata": { "kernelspec": { - "display_name": "Julia 1.4.1", + "display_name": "Julia 1.10.2", "language": "julia", - "name": "julia-1.4" + "name": "julia-1.10" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.4.1" + "version": "1.10.2" } }, "nbformat": 4, diff --git a/drawing-scripts/elliptical-orbit-definitions.ipynb b/drawing-scripts/elliptical-orbit-definitions.ipynb index 3abc1aa5..f58349ad 100644 --- a/drawing-scripts/elliptical-orbit-definitions.ipynb +++ b/drawing-scripts/elliptical-orbit-definitions.ipynb @@ -112,7 +112,7 @@ "\n", " offset /= 5\n", " end\n", - " \n", + "\n", " @layer begin\n", " setcolor(252/255, 141/255, 98/255, 1.0)\n", " circle(semimajor, 0, pointradius/2, :fill)\n", @@ -162,15 +162,15 @@ ], "metadata": { "kernelspec": { - "display_name": "Julia 1.6.3", + "display_name": "Julia 1.10.2", "language": "julia", - "name": "julia-1.6" + "name": "julia-1.10" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.6.3" + "version": "1.10.2" } }, "nbformat": 4, diff --git a/drawing-scripts/time-since-periapsis-area.ipynb b/drawing-scripts/time-since-periapsis-area.ipynb new file mode 100644 index 00000000..c8640478 --- /dev/null +++ b/drawing-scripts/time-since-periapsis-area.ipynb @@ -0,0 +1,175 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "f3e1ca6c-23e3-4764-b1fb-8d970d310112", + "metadata": {}, + "outputs": [], + "source": [ + "using Luxor, LightXML" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "d2a3ba7b-3e72-4301-aba6-b555ad30cfc7", + "metadata": {}, + "outputs": [], + "source": [ + "pointradius = 4\n", + "linewidth = 2;" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "id": "ce4c8295-bd78-4022-9d00-35ed0851dfad", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [] + }, + "execution_count": 77, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "drawing_height = 400\n", + "drawing_width = 500\n", + "Drawing(drawing_width, drawing_height, :svg)\n", + "box(O, Point(drawing_width, drawing_height), :stroke)\n", + "# bbox = BoundingBox(;centered=false)\n", + "x_axis_height = 13/16*drawing_height\n", + "origin(drawing_width/2, x_axis_height)\n", + "\n", + "@layer begin\n", + " setdash(\"dash\")\n", + " setline(linewidth/2)\n", + " rule(O)\n", + "end\n", + "\n", + "origin(100, x_axis_height)\n", + "semimajor = 300\n", + "periapsis = Point(semimajor, 0)\n", + "r_p = 65\n", + "m1 = Point(semimajor - r_p, 0)\n", + "e = 1 - r_p/semimajor\n", + "semiminor = -semimajor * sqrt(1 - e^2)\n", + "epoly = ellipse(m1, -m1, 2semimajor, vertices=true)\n", + "B = epoly[60]\n", + "angle = slope(m1, B)\n", + "circle_point = B * Point(1, -semimajor/semiminor)\n", + "angle_E = slope(O, circle_point)\n", + "\n", + "@layer begin\n", + " setcolor(sethue(\"goldenrod\")..., 0.8)\n", + " move(periapsis)\n", + " poly(epoly[60:101])\n", + " carc(O, semimajor, 0, angle_E)\n", + " fillpath()\n", + "end\n", + "@layer begin\n", + " setcolor(sethue(\"mediumpurple\")..., 0.2)\n", + " move(O)\n", + " line(circle_point)\n", + " line(m1)\n", + " line(O)\n", + " fillpath()\n", + "end\n", + "@layer begin\n", + " setcolor(sethue(\"mistyrose\")..., 0.8)\n", + " move(epoly[60])\n", + " poly(epoly[60:101])\n", + " line(m1)\n", + " line(epoly[60])\n", + " fillpath()\n", + "end\n", + "\n", + "@layer begin\n", + " setcolor(\"gray80\")\n", + " circle(m1, pointradius, :fill)\n", + " circle(O, semimajor, :stroke)\n", + " circle(O, pointradius, :fill)\n", + "end\n", + "@layer begin\n", + " setcolor(141/255, 160/255, 203/255, 1.0)\n", + " poly(epoly, :stroke)\n", + "end\n", + "@layer begin\n", + " setline(linewidth/2)\n", + " line(m1, B, :stroke)\n", + " arrow(m1, semimajor/5, 0, angle, clockwise=false)\n", + " arrow(O, 50, 0, angle_E, clockwise=false)\n", + " line(Point(B.x, 0), circle_point, :stroke)\n", + " line(O, circle_point, :stroke)\n", + " # line(m1, circle_point, :stroke)\n", + "end\n", + "\n", + "top_left_corner = getworldposition(Point(0, 0), centered=false)\n", + "finish()\n", + "preview()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "48a2242c-c291-4e13-bc40-bccc228ce5b4", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ac93eb1a-1e34-4db4-b612-2623af426e7c", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Julia 1.10.2", + "language": "julia", + "name": "julia-1.10" + }, + "language_info": { + "file_extension": ".jl", + "mimetype": "application/julia", + "name": "julia", + "version": "1.10.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}