-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slider image of curves is more acute than actual curve #332
Comments
It's unclear what is being proposed here. @amanda-phet how would you change things? @veillette this one is more in your wheelhouse. Let me know if you want to discuss. |
Yes will do |
The CurveManipulationDisplayNode has the same x-range has the actual curve, that is from 0-10, but the yRange is different. It goes -0.25 to 1.25 whereas the graph y range goes from -2 to 2. As a result of the different model y-range for the slider, the actual aspect ratio is off by a factor of 8/3 or 2.66. The reason for the non symmetric y range was of the slider is that most of our functions are not symmetric over the y-range (the only exception being the sinusoid function).
We could potentially use a symmetric y-range and draw all the curves with an offset, except for the sinusoid. If we did so, the triangle slope would match on the slider and the graph.
|
Let me work on a patch which would better for a side-by-side comparison. |
So there is a tension about respecting the aspect ratio and maximizing the vertical real estate. The patch below preserved the aspect ratio but since most of the functions are one-sided, that it, their y-values are solely positive, than there is a bit more blank space. Subject: [PATCH] more accurate description of cusps (see #263)
---
Index: js/common/view/CurveManipulationDisplayNode.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/CurveManipulationDisplayNode.ts b/js/common/view/CurveManipulationDisplayNode.ts
--- a/js/common/view/CurveManipulationDisplayNode.ts (revision 8e93633415d07ce3bbf4db4e0e48fcb06bcfac9b)
+++ b/js/common/view/CurveManipulationDisplayNode.ts (date 1680639037331)
@@ -87,14 +87,14 @@
curve.parabola( width, xCenter, yMax );
}
else if ( mode === CurveManipulationMode.SINUSOID ) {
- curve.sinusoid( width, xCenter, yMax / 2 );
- curve.shift( xCenter, yMax );
+ curve.sinusoid( width, xCenter, -yMax );
}
else if ( mode === CurveManipulationMode.FREEFORM ) {
CurveManipulationIconNode.freeformIconCurve( curve, yMin, yMax );
}
else if ( mode === CurveManipulationMode.TILT ) {
- curve.tilt( xMax, yMax );
+ curve.tilt( xMax, 2 * yMax );
+ curve.shift( 0, -yMax );
}
else if ( mode === CurveManipulationMode.SHIFT ) {
curve.shift( xMax, yMin );
Index: js/common/CalculusGrapherConstants.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/CalculusGrapherConstants.ts b/js/common/CalculusGrapherConstants.ts
--- a/js/common/CalculusGrapherConstants.ts (revision 8e93633415d07ce3bbf4db4e0e48fcb06bcfac9b)
+++ b/js/common/CalculusGrapherConstants.ts (date 1680635576579)
@@ -77,8 +77,8 @@
0.5 * CURVE_X_LENGTH,
0.20 * CURVE_X_LENGTH ),
- // model height associated with curveManipulationDisplay (in the same unit as x-Range)
- CURVE_MANIPULATION_Y_RANGE: new Range( -0.25, TYPICAL_Y + 0.25 ),
+ // model height associated with curveManipulationDisplay
+ CURVE_MANIPULATION_Y_RANGE: new Range( -2, 2 ),
// maximum of undo actions (See https://github.com/phetsims/calculus-grapher/issues/64)
MAX_UNDO: 20, |
Signed-off-by: Martin Veillette <[email protected]>
@pixelzoom and I went back and forth about an appropriate solution. We settled on maintaining the aspect ratio of the curve manipulation display node such that the y -range is the same on the graph.
The curves themselves have been shifted a bit downward display has been shifted a bit, such that there is a bit of negative space above and below the curve. On the fourth screen, the graphs themselves are not isometric, whereas our slider display is isometric, so there is a slight mismatch in the aspect ratio (although it is still an improvement over the previous mismatch noted by @KatieWoe) It is a lot of small tweaks that affects all the curve manipulation modes so perhaps it would be easier for @amanda-phet to take a look on master. I would be happy to walk you through the changes. |
This is an excellent improvement. Nice suggestion @KatieWoe. |
This is looking great to me. Thanks @KatieWoe for suggesting it. |
Thanks @amanda-phet for the thumbs up. At this point, the commit is already on master, but we will need to cheery pick it on the RC branch. |
Signed-off-by: Martin Veillette <[email protected]> (cherry picked from commit bfc57fb)
The commit was pushed on the 1.0 branch. |
To verify in the next RC: In PhET brand, verify that:
|
Following #332 (comment), this looks good in rc.2. |
Reopening because I also see this with the hill and the width of the pedestal, and even the sin wave to an extent. Should those be looked at too? |
@KatieWoe FYI Martin Veillette |
Correct, this is just for the triangle and parabola. |
Test device
Samsung and iPad
Operating System
Win 11 and iPadOS 16
Browser
Chrome and Safari
Problem description
For phetsims/qa#924
The curve that is created on a line is more obtuse than the image shown on the slider. This is easiest to see with the triangle since it is easiest to see it's angle. Discussed with @amanda-phet and we thought it was worth a look.
Steps to reproduce
Visuals
Troubleshooting information:
!!!!! DO NOT EDIT !!!!!
Name: Calculus Grapher
URL: https://phet-dev.colorado.edu/html/calculus-grapher/1.0.0-rc.1/phet/calculus-grapher_all_phet.html
Version: 1.0.0-rc.1 2023-03-28 17:54:45 UTC
Features missing: applicationcache, applicationcache, touch
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Language: en-US
Window: 1536x714
Pixel Ratio: 1.25/1
WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium)
GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 31 uniform: 4096
Texture: size: 8192 imageUnits: 32 (vertex: 32, combined: 64)
Max viewport: 8192x8192
OES_texture_float: true
Dependencies JSON: {}
The text was updated successfully, but these errors were encountered: