-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add a flat mirror #227
Comments
For phetsims/qa#723 |
I like this suggestion a lot. But I don't know what the implications would be. So far, I've been able to avoid changing the core model for the rays and images. Diving into that code will involve more time, more changes. I'm guessing this would add ~20-40 hours to my original estimate. |
@kathy-phet said:
I should point out that there are no "scenes" in this sim. Scenes have their own state, and that's not the case here for the different mirror (or lens) shapes. The radio buttons simply select the shape of the single mirror (or lens), they are not separate scenes. We can certainly change this if you really want scenes, but it will be a significant lift. |
Beyond the model support for a flat mirror, this is going to require significant changes througout the sim. There are multiple problems... (1) There are currently "curve types" (concave, convex) and the code assumes that they are supported for both types of optic (lens, mirror). If we add a "flat" curve type that's supported only for mirror, that changes the assumption that all curve types are supported by all optics. (2) The code assumes that the optic is either converging or diverging. A flat mirror is neither. So foundational code, like this function in Optic.js which is supposed to handle both lens and mirror, is not going to work correctly: isConverging( curve ) {
return ( this.isConvex( curve ) && this.isLens() ) || ( this.isConcave( curve ) && this.isMirror() );
} |
That’s exactly what I was hoping would be the case! :) thanks.
…Sent from my iPhone
On Oct 20, 2021, at 7:14 PM, Martin Veillette ***@***.***> wrote:
In the way we implement th ray tracing and the images, a flat mirror shares many similarity with a diverging mirror with an extremely long radius of curvature. Setting the max value of the radius of curvature to 100 000 cm, we can see that the model for the image behaves well and the ray tracing works correctly.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
That's good news that the model behaves like a flat mirror when given a large radius of curvature (ROC). But it's one thing to poke a very large ROC into the code, and another thing to make it work in practice. Among the problems we would need to address are:
|
10/21/2021 design meeting: @arouinfar @kathy-phet @ariel-phet
|
For a flat mirror, change the Diameter label to "Height" in the Basics version of the sim. |
In #255, we added an option to replace ROC+IOR controls with a Focal Length control. I'm wondering what we should do with the Focal Length control when 'flat' mirror is selected. Hide the control? Change it to a read-out that shows infinity? Something else? Also wondering if we should replace the ROC control with a read-out that shows infinity, instead of hiding it totally. |
Discussed with @arouinfar.
|
The flat mirror looks great. It's a bit odd for it to be off-center, but for consistency, I know that it needs to stay in place. However, for Basics, I think we should center the flat mirror in the play area since it's the only type of mirror.
This looks good in Studio and I think it's best to use the real values in the model. Looks like
Agreed. The tricky part will be keeping the image position on-screen for all 3 types of mirrors. Shifting the object closer to the mirror will ensure the image of the flat mirror is starts on-screen, but will push the image of the concave mirror off-screen. An initial position of { "x": -130, "y": 72.5 } looks pretty good to me if we reduce also the initial ROC to 180 cm. |
I can certainly pull that off. But I'll need to add 5 Properties. For any Property that can have value
|
That seems to work for the framed objects. What initial positions do you want for the 2 arrows? |
… of framed object and arrows, #227
@arouinfar and I met on Zoom to adjust the initial positions of objects in the Mirror screen, as well as the initial ROC and focal length. Those changes are in the above commit. As for the issue of showing physically-correct values as discussed in #227 (comment) ... This is a slippery slope. There are at least 7 such Propertes: focalLengthProperty, radiusOfCurvatureProperty, leftFocalPointProperty, rightFocalPointProperty, twiceFocalLengthProperty, left2FProperty, right2FProperty. (1) Show physically-correct values for all Properties. This is more development work, makes the code more difficult to understand, and requires documentation warning the client that their programs need to handle (2) Show physically-correct values for focalLengthProperty and radiusOfCurvatureProperty, finite (Hollywood) values for the others. This is less development work than (1), and is inconsistent: it still makes the code difficult to understand, and still requires documentation warning the client that their programs need to handle (3) Show finite (Hollywood) values for all Properties. This is the least amount of development work, and the code is easiest to understand. Client documentation is still needed, but telling them to interpret very-large values as "infinity". We're currently doing (2), which I think is the least desirable option. I'm not going to do anything further about this until @arouinfar and @kathy-phet have discussed. |
@kathy-phet can you take a look at this issue when looking over Geometric Optics? |
@pixelzoom I'm leaning towards option (3). I just don't think (1) is worth the hassle and (2) is increasingly strange, especially now that we expose the |
@arouinfar I agree, (3) seems best. (1) is a slippery slope. Would you like me to implement (3), or are we still waiting for input from @kathy-phet? |
Let's proceed with (3) @pixelzoom. |
Done in the above commit. @arouinfar please review in master. |
Looks good in master, thanks @pixelzoom |
In playing with the sim today, I was desiring to take the mirror flat. So adding this for consideration as we think about the final improvements after the prototype. Physics is basically just a virtual image behind the mirror and equidistant and same size as the object. Suggestion would be a third scene on mirror that was flat. Note - I haven't thought thru all the issues this suggestion may bring up. Just thinking about how flat mirrors are a pretty common goal/topic and what is in everyone's everyday life all the time.
The text was updated successfully, but these errors were encountered: