Skip to content

Commit

Permalink
doc about createCoilSegments, #101
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Mar 13, 2024
1 parent 567ab2f commit b6c3efc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/common/model/Coil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ export default class Coil extends PhetioObject {
* WARNING! This method is particularly complicated. The segments that it creates have been tuned so that all
* segments are smoothly joined to form a pseudo-3D coil. If you change values, do so with caution, test frequently,
* and perform a close visual inspection of your changes.
*
* Note that there are several 'magic numbers' in this method that were empirically determined long ago in the Java
* version of this sim. That method ported directly from Java very nicely, and those constants are now almost
* 20 years old, which is downright elderly in code-years. So rather than disturb them by trying to factor out
* constants, it seemed preferable to leave them alone.
*/
private static createCoilSegments( numberOfLoops: number, loopRadius: number, wireWidth: number, loopSpacing: number,
frontColor: TColor, middleColor: TColor, backColor: TColor ): CoilSegment[] {
Expand Down

0 comments on commit b6c3efc

Please sign in to comment.