<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>sounds interesting! I have a few thoughts regarding package dependencies.</p>
<p><br>
</p>
<p>As far as I understand, the dependency structure would look kind like this:</p>
<p><br>
</p>
<p><span>Kernel-Objects -> <span>Math-Quantity (see senders of SmallInteger for example), Math-Analysis (see senders of #asFloat for example)</span></span><br>
</p>
<p><span><span><span>Math-Quantity -> Kernel (superclass), Math-Analysis (see senders of #asFloat)</span><br>
</span></span></p>
<p><span><span><span><span>Math-Analysis -> Kernel (superclass), Math-Quantity (maybe?)</span><br>
</span></span></span></p>
<p><span><span><span><span><span>Math-Geometry -> Kernel (of course), Math-Quantity (senders of SmallInteger), Math-Analysis (see senders of #asFloat)</span><br>
</span></span></span></span></p>
<p><span><span><span><span><span><span>Math-Collections would probably depend on all other packages?</span><br>
</span></span></span></span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>The question is which of these dependencies can be eliminated and which are a problem at all.</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>What about Random? Do you want to keep it in Kernel, depending on Math?</span></span></p>
<p><br>
</p>
<p>What is about dependencies from Number (Kernel-Objects) to Float (Math-Analysis), for example, #asFloat, but also sophisticated things such as #sin? Do we want to create a bunch of extension methods for this?</p>
<p>In any case, I think the "math functions" protocol on Collection should become an extension protocol ("*Math-Analysis" or "*Math-Analysis-enumerating").</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="_rp_T4" id="Item.MessagePartBody"><br>
</div>
<div class="_rp_T4" id="Item.MessagePartBody">Best,</div>
<div class="_rp_T4" id="Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Dienstag, 9. März 2021 10:50:09<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> [squeak-dev] About a new "Math" package ... (was: Proposal: Geometry Classes)</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hi all!
<div class="mb_sig"></div>
<div><br>
</div>
<div>I think that we would rather need a "Math" package with "Math-Geometry" being one of multiple categories.</div>
<div><br>
</div>
<div>Please take a look at the following proposed classification:</div>
<div><br>
</div>
<div>
<div><span style="font-size: 13.3333px">Kernel-Objects (= not Kernel-Numbers)</span></div>
<div><span style="font-size: 13.3333px">  Magnitude</span></div>
<div><span style="font-size: 13.3333px">    Number</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Math-Quantity</span></div>
<div><span style="font-size: 13.3333px">  Integer (+ subclasses)</span></div>
<div><span style="font-size: 13.3333px">  Fraction</span></div>
<div><span style="font-size: 13.3333px">  ScaledDecimal</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Math-Analysis</span></div>
<div><span style="font-size: 13.3333px">  Complex</span></div>
<div><span style="font-size: 13.3333px">  Float (+ subclasses)</span></div>
<div><span style="font-size: 13.3333px">  Quaternion</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Math-Geometry</span></div>
<div><span style="font-size: 13.3333px">  Point</span></div>
<div><span style="font-size: 13.3333px">  Line</span></div>
<div><span style="font-size: 13.3333px">  Rectangle</span></div>
<div><span style="font-size: 13.3333px">  Polygon</span></div>
<div><span style="font-size: 13.3333px">  Path</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Math-Collections</span></div>
<div><span style="font-size: 13.3333px">  Vector2 (from 3DTransform, CroquetGL, etc.)</span></div>
<div><span style="font-size: 13.3333px">  Vector3</span></div>
<div><span style="font-size: 13.3333px">  Vector4</span></div>
<div><span style="font-size: 13.3333px">  Matrix2x3</span></div>
<div><span style="font-size: 13.3333px">  Matrix4x4</span></div>
<div><span style="font-size: 13.3333px">  VectorArray</span></div>
<div><span style="font-size: 13.3333px">  ...</span></div>
</div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">It would involve some effort, especially to untangle "ST80-Paths" from graphics :-) Eventually, I would like to see Nicolas' efforts for "Complex" and "Quaternion" in Trunk. And I would like to add that "number crunching"
 part around fancy graphics (e.g. OpenGL through FFI) to "Math-Collections" or maybe "MathExtras-Collections", looking at all the subclasses of RawBitsArray.</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">May I add "Math" and "MathExtras" packages so that we can slowly get started? :-)</span></div>
<div><span style="font-size: 13.3333px"><br>
</span></div>
<div><span style="font-size: 13.3333px">Best,</span></div>
<div><span style="font-size: 13.3333px">Marcel</span></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 22.01.2019 18:32:10 schrieb patrick.rein@hpi.uni-potsdam.de <patrick.rein@hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">Hi everyone,<br>
<br>
during some recent clean-up an issue with geometry objects came up. As a result the following idea came up which I thereby would like to put out for an initial discussion.
<br>
<br>
In case we find that this might be useful, I would continue by implementing a first prototype of the package as a foundation of a more in-depth discussion later on.<br>
<br>
Bests<br>
Patrick<br>
<br>
# Squeak Change Proposal - Geometry Package <br>
<br>
## Why? <br>
Squeak implements basic geometry logic in too many different places. For example intersection of different kinds of geometric objects is implemented all over Morphic, ST80, Balloon, Graphics, and Etoys. Such extensive scattering across packages and classes
 impedes modularity, that is, readability and extensibility. An example for this recently came up when we discovered an issue with testing for graphical intersections between PolygonMorph and RectangleMorph. It was not possible to compute that overlapping area
 because the class Rectangle omits to provide an important method. A quick fix would entail unnecessary dependencies (here: Morphic -> Balloon) or duplicated code (see also http://bugs.squeak.org/view.php?id=7872). Consequently, we might want to modularize
 the geometry objects and operations. As a side effect, dependent packages such as Morphic can be simplified a little bit (more).<br>
<br>
## Scope <br>
The proposed package should cover basic 2D geometric objects and their operations represented by the following classes:<br>
- Point <br>
- Line <br>
- LineSegment <br>
- Polygon <br>
- Rectangle (as an optimization as it could be represented as a special Polygon already)
<br>
<br>
Most classes could simply be moved from their previous packages. Afterwards the interfaces would need to be made consistent with each other to allow interoperability of all geometry classes within the new package.
<br>
<br>
### Affected classes:<br>
- All classes in ST80-Paths<br>
- LineSegement, Bezier2Segment, Bezier3Segment (Balloon-Geometry)<br>
- Rectangle, Quadrangle, Point (Graphics-Primitives)<br>
- LineIntersections, LineIntersectionSegment, LineIntersectionEvent (Etoys-Squeakland-Graphics-Tools-Intersection)<br>
<br>
## Open questions <br>
- Should this become a single new package or a subcategory in the Graphics package?
<br>
- Should the package contain an Ellipses class? <br>
- Should we model curved line segments as BezierLineSegments, CurvedLineSegment, or Arc?<br>
<br>
## Risks <br>
- This would potentially deprecate the existing ST80 geometry classes (ST80-Paths)<br>
- Some of the new classes will cause name clashes with existing classes. For example Line is currently in ST-80 and represents a line segment, and the class LineSegment is a line segment but not in the geometric sense as it also incorporates arcs. Both names
 might then be used by new classes with different meanings. This might be mitigated by introducing a pre-/postfix for the names of the new classes.<br>
<br>
</div>
</blockquote>
</div>
</div>
</body>
</html>