Skip to content

Commit

Permalink
ensure right margin is not exceeded for comments (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
veillette committed Jul 29, 2021
1 parent f6b1e99 commit 9d74f52
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
3 changes: 2 additions & 1 deletion js/common/model/LightRay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions js/common/model/Optic.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class Optic {
// @public {Property.<Vector2>} Position of the optical element
this.positionProperty = new Vector2Property( position );

// @public {Property.<number>} Radius of curvature of the optical element - The convention is positive as converging.
// @public {Property.<number>} Radius of curvature of the optical element - The convention is positive as
// converging.
this.radiusOfCurvatureProperty = new NumberProperty( radiusOfCurvatureRange.defaultValue,
{ range: radiusOfCurvatureRange } );

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions js/common/model/Target.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/ShowHideToggleButton.js
Original file line number Diff line number Diff line change
@@ -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)
*/
Expand Down
10 changes: 6 additions & 4 deletions js/lens/model/Guide.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,24 @@ class Guide {
return opticPosition.plusXY( 0, locationSign * opticDiameter / 2 );
} );

// @public (read-only) {Property.<number>} angle of rotation of the incident guide with respect to the positive x-axis
// @public (read-only) {Property.<number>} 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.<number>} find the angle of the transmitted guide with respect to the positive x-axis
// @public (read-only) {Property.<number>} 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 );
Expand Down

0 comments on commit 9d74f52

Please sign in to comment.