question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Matrix.display() does not work for default value

See original GitHub issue

I wrote the following code to run an example for Matrix.display()

from raytracing import *
M= Matrix(A=1,B=3,C=1,D=4)
M.display()

It does not display anything and it does not rais any error. when I add other inputs of the matrix It works properly.

from raytracing import *

M1= Matrix(A=1,B=3,C=-1/3,D=1,physicalLength=3,frontVertex=4,
           backVertex=2,frontIndex=1,backIndex=1,apertureDiameter=6,
           label='Lens')
M1.display()

I suggest to add some errors or change the default value so it works!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dccotecommented, May 22, 2020

Good point: front and back vertices really represent actual physical interfaces, so it is possible to not have any (Space(d=10) is an example of such matrix). Constructing a matrix manually is possible, but it needs to fill certain requirements: the determinant must be at least n1/n2 (or the inverse, I don’t remember), and if C != 0, then vertices must be defined for sure because C is the power (-1/f) and therefore there must be vertices. If these conditions are not filled, we should raise an ValueError()

0reactions
JLBegincommented, Jun 16, 2020

N.B.: The code for Matrix.display() is now under raytracing.figure.MatrixGraphic.display()

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: Use the 'defaultValue' or 'value' props on <select ...
I want to display that dropdown and make that option a default value which was selected by that user last time. I am...
Read more >
sklearn.metrics.ConfusionMatrixDisplay
By default, labels will be used if it is defined, otherwise the unique labels of y_true and y_pred will be used. include_valuesbool, default=True....
Read more >
Default Array Values in Java - GeeksforGeeks
If we don't assign values to array elements and try to access them, the compiler does not produce an error as in the...
Read more >
Logical functions | ArcGIS Arcade
If no matches are found, then a default value may be provided. ... However, if this value is an empty array, then the...
Read more >
Set output display format - MATLAB format - MathWorks
This MATLAB function changes the output display format to the format ... Use the shortG format when some of the values in an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found