From 9d74f528faf8dbd70312a15f9fc73589a5b6ad34 Mon Sep 17 00:00:00 2001 From: Martin Veillette Date: Thu, 29 Jul 2021 11:56:23 -0400 Subject: [PATCH] ensure right margin is not exceeded for comments (#129) --- js/common/model/LightRay.js | 3 ++- js/common/model/Optic.js | 7 ++++--- js/common/model/Target.js | 4 ++-- js/common/view/ShowHideToggleButton.js | 4 ++-- js/lens/model/Guide.js | 10 ++++++---- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/js/common/model/LightRay.js b/js/common/model/LightRay.js index f18d76a6..8b7d4c85 100644 --- a/js/common/model/LightRay.js +++ b/js/common/model/LightRay.js @@ -436,7 +436,8 @@ class LightRay { // update the real shape based on the traveling distance of the ray being processed this.updateShape( this.realShape, currentRay, realRayDistance ); - // wait to process virtual ray until the virtual starting point matches the starting point of the ray being processed + // wait to process virtual ray until the virtual starting point matches the starting point of the ray being + // processed if ( this.virtualRay instanceof Ray && this.virtualRay.position === currentRay.position ) { // determine the distance of the virtual ray diff --git a/js/common/model/Optic.js b/js/common/model/Optic.js index af9cd7b4..65f196fb 100644 --- a/js/common/model/Optic.js +++ b/js/common/model/Optic.js @@ -47,7 +47,8 @@ class Optic { // @public {Property.} Position of the optical element this.positionProperty = new Vector2Property( position ); - // @public {Property.} Radius of curvature of the optical element - The convention is positive as converging. + // @public {Property.} Radius of curvature of the optical element - The convention is positive as + // converging. this.radiusOfCurvatureProperty = new NumberProperty( radiusOfCurvatureRange.defaultValue, { range: radiusOfCurvatureRange } ); @@ -190,8 +191,8 @@ class Optic { * * The lens shape is approximated as a parabolic lens. * The radius of curvature of the lens does necessarily match the value of radius and can be instead "hollywooded". - * This gives the flexibility to draw lenses with radius of curvature that is larger than diameter/2, a physical impossibility. - * The center point of the lens is '0,0' + * This gives the flexibility to draw lenses with radius of curvature that is larger than diameter/2, a physical + * impossibility. The center point of the lens is '0,0' * * @param {number} radius - radius of curvature * @param {number} diameter - height of the lens diff --git a/js/common/model/Target.js b/js/common/model/Target.js index 8a3ef451..a44a0a48 100644 --- a/js/common/model/Target.js +++ b/js/common/model/Target.js @@ -105,8 +105,8 @@ class Target { this.isInvertedProperty ], ( position, representation, scale ) => { - // @public {Vector2} displacement vector from the firstPosition to the left top - value depends on representation - // values are in centimeters + // @public {Vector2} displacement vector from the firstPosition to the left top - value depends on + // representation values are in centimeters const initialOffsetPosition = representation.offsetPosition.timesScalar( 1 / OBJECT_SCALE_FACTOR ); const initialWidth = representation.dimensions.width / OBJECT_SCALE_FACTOR; const initialHeight = representation.dimensions.height / OBJECT_SCALE_FACTOR; diff --git a/js/common/view/ShowHideToggleButton.js b/js/common/view/ShowHideToggleButton.js index eee0f455..f87a858a 100644 --- a/js/common/view/ShowHideToggleButton.js +++ b/js/common/view/ShowHideToggleButton.js @@ -1,8 +1,8 @@ // Copyright 2021, University of Colorado Boulder /** - * Round eye toggle button that shows/hides the light rays and image. When on 'show', button is an open eye. On 'hide', button is - * a closed eye. + * Round eye toggle button that shows/hides the light rays and image. When on 'show', button is an open eye. On 'hide', + * button is a closed eye. * * @author Sarah Chang (Swarthmore College) */ diff --git a/js/lens/model/Guide.js b/js/lens/model/Guide.js index 1d736f99..32f8eae3 100644 --- a/js/lens/model/Guide.js +++ b/js/lens/model/Guide.js @@ -33,22 +33,24 @@ class Guide { return opticPosition.plusXY( 0, locationSign * opticDiameter / 2 ); } ); - // @public (read-only) {Property.} angle of rotation of the incident guide with respect to the positive x-axis + // @public (read-only) {Property.} angle of rotation of the incident guide with respect to the positive + // x-axis this.incidentAngleProperty = new DerivedProperty( [ objectPositionProperty, this.fulcrumPositionProperty ], ( objectPosition, fulcrumPosition ) => { const displacementVector = objectPosition.minus( fulcrumPosition ); return displacementVector.getAngle(); } ); - // @public (read-only) {Property.} find the angle of the transmitted guide with respect to the positive x-axis + // @public (read-only) {Property.} find the angle of the transmitted guide with respect to the positive + // x-axis this.transmittedAngleProperty = new DerivedProperty( [ optic.focalLengthProperty, optic.diameterProperty, this.incidentAngleProperty ], ( focalLength, diameter, incidentAngle ) => { // transmitted angle if the optic was a blank. const throughAngle = incidentAngle + Math.PI; - // ground truth for the deflection angle is determined such that the transmitted guide is perfectly aligned with rays - // when the object is at a distance 2f on the optical axis. + // ground truth for the deflection angle is determined such that the transmitted guide is perfectly aligned + // with rays when the object is at a distance 2f on the optical axis. // ratio of opposite side (diameter/2) over adjacent side (2*focalLength) const toa = diameter / ( 4 * focalLength );