Write a program to calculate the angle of incidence (in degrees) of a light ray in Region 2 given the angle of incidence in Region 1 and the indices of refraction n1 and n2. (Note: If n2>n1, then for some angles 1, Equation 2 will have no real solution because the absolute value of the quantity will be greater than 1. When this occurs, all light is reflected back into Region 1, and no light passes into Region 2 at all. Your program must be able to recognize and properly handle this condition.) The program should also create a plot showing the incident ray, the boundary between the two regions, and the refracted ray on the other side of the boundary. Test your program by running it for the following two cases: (a) n1= 1.0, n2 = 1.7, and 1= 45°. (b) n1 = 1.7, n2 = 1.0; and 1= 45°

Answers

Answer 1

The program is an illustration of conditional statements

What are conditional statements?

conditional statements are statements that are used to make decisions

The main program

The program written in Python, where comments are used to explain each line is as follows

#This imports the math module

import math

#This get sthe refraction index 1

n1 = float(input("Refraction index 1: "))

#This get sthe refraction index 2

n2 = float(input("Refraction index 2: "))

#This gets the normal angle of incidence in region 1

theta1 = float(input("Normal of incidence in region 1 (degrees): "))

#If n1 is greater than n2, then there is no real solution

if n1 > n2:

   print("No real solution")

#If otherwise

else:

   #This calculates the angle of incidence

   theta2 = math.asin(n1/n2 * math.sin(math.radians(theta1))) * (180/math.pi)

   #This prints the angle of incidence

   print("Angle of incidence",round(theta2,2),"degrees")

Note that the program only calculates the angle of incidence, it does not print the plot

Read more about conditional statements at:

https://brainly.com/question/24833629


Related Questions

Let cell E2 = 100, what is the result of this formula? =NOT(E2<100) *

Answers

Answer:

True

Explanation:

Using the data for the JC Consulting database shown in Figure 2-1, identify the one-to-many relationships as well as the primary key fields and foreign key fields for each of the five tables.

Answers

The JC consulting database is a structure used to store organized information of JC consulting

How to identify the relationship

From the figure, we can see that the cardinality of the project table and the client table is 1 : many.

Similarly, the cardinality of the project table and the ProjectLifeItems is 1 : many.

Hence, the one-to-many relationships are Project & Clients and Project & ProjectLifeItems

How to identify the primary key

This is the key on the first table (i.e. the client table)

Hence, the primary key field is ClientID

How to identify the foreign keys

These are the fields that correspond to the primary key on the client table

The fields that correspond to ClientID are ProjectID, EmployeeID, TaskID and ProjectLifeItemsID

Hence, the foreign keys are ClientID are ProjectID, EmployeeID, TaskID and ProjectLifeItemsID

Read more about database at:

https://brainly.com/question/24223730

g A 32-bit computer has a MUL (multiply) instruction. The documentation for this instruction says that the answer appears in the HI and LO registers 8 cycles after the MUL instruction executes, and that another MUL instruction should not be executed until these registers are loaded. What type of multiplier does the CPU have

Answers

Answer: The MIPS R4000

According to Raymond from Microsoft Blogs, "The MIPS R4000 can perform multiplication and division in hardware, but it does so in an unusual way, and this is where the temperamental HI and LO registers enter the picture.

The HI and LO registers are 32-bit registers which hold or accumulate the results of a multiplication or addition. You cannot operate on them directly. They are set by a suitable arithmetic operation, and by special instructions for moving values in and out."

Explanation:

Based on the information, the CPU in the 32-bit computer has a "multi-cycle multiplier" or a "pipelined multiplier."

What is the documentation

Both of these multipliers need more than one clock cycle to finish the multiplication. The information says that the answer will show up in the HI and LO registers 8 cycles after the MUL instruction. This means that the multiplication process is split into many parts, and each part takes one unit of time to finish.

The HI and LO registers are often used in a 32-bit computer to store the first 32 bits and the last 32 bits of the answer, respectively.

Read more about multiplier  here:

https://brainly.com/question/15883095

#SPJ3

Which of the following tools is used to cut objects along a freehand path drawn with it, and to divide objects into component-filled faces?

Answers

Knife Tool

Hope this helps (:

If I went to universals during Gradventure would I be able to use an express pass

Answers

Even though its a school trip I think it would be allowed since its your money i mean they cant really deny it

Also are you going this year or next year? I am too!

Answer:

I believe it would still be honored

Explanation:

I don't see anywhere where it states that you cannot use it

Consider that we want to write a function compare to compare a Cat from question B1 and a Dragon from question B2. If we want this to be a friend function, what do we do and why? Assume that a particular Cat is considered better than a particular Dragon if the product of the tail length and number of teeth is greater than the age of the dragon. Write the implementation of such a function.​

Answers

It’s c because I did it to

2. What is the difference between requirement validation and requirement
verification?

Answers

Validation focuses on whether the software meets the expectations and requirements of the end user. Verification finds potential issues early in the product development process. Validation finds any issues that verification missed

A _____ acts as an interface to a database, retrieving data for users and allowing users to enter data in the database. Group of answer choices data-driven Web site flat Web page stationary Web page static Web site

Answers

Answer:

A database management system

Explanation:

Also known as DBMS

a. The two programs perform the same function. Describe it. b. Which version performs better, and why

Answers

Programs are series of instructions interpreted by a computer

The description of the program is to compute the square of the difference between corresponding elements of two arraysThe better version of the program is program A.

How to describe the programs

From the programs, we have the following highlights

The program iterates from 1 to n - 1The iteration calculates the difference between corresponding elements of the arraysThe difference is then squared

Hence, the description of the program is to compute the square of the difference between corresponding elements of two arrays

The better version

The better version of the program is program A.

This is so, because the program uses fewer instructions for the same task as program B

Read more about programs at:

https://brainly.com/question/16397886

Need comments added to the following java code:

public class Point {

private double x;

private double y;

private String type;

public void setXY(double xx, double yy) {
x = xx;
y = yy;
}

public double getY() {
return y;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public double[] getDimensions() {
return new double[] { x, y };
}

public String toString() {
return "Point [" + x + ", " + y + "] is " + type;
}
}

Answers

Answer: Are there options for this?

Explanation:

Imagine that a school decided to use a database to track television shows that students are watching. What would be some of the advantages and disadvantages of tracking students in this way?

Answers

Answer:

Invasion of privacy, as well as concerns on the validity of the information, would rise.

Explanation:

This are world wide known negatives, as well as too many variables leads to lack of solid information.

A keyboard would be considered what 2 things

Answers

Answer:

A typing tool and a weapon

Explanation:

Ingredient Adjuster
A cookie recipe calls for the following ingredients:
1.5 cups of sugar
1 cup of butter
2.75 cups of flour
The recipe produces 48 cookies with these amounts of the ingredients. Design a pro- gram that asks the user how many cookies he or she wants to make, and then displays the number of cups of each ingredient needed for the specified number of cookies.

Answers

Answer:

#include <iostream>

using namespace std;

int main(){

float cookies=0;

float sugar=1.5;

float butter=1;

float flour=2.75;

cout<<"how many cookies do you want: "<<endl;

cin>>cookies;

float num = cookies/48;

cout<<num<<endl;

cout<< "to make " << cookies<<"cookies you need: "<<endl;

cout<<"sugar cups: "<<num*sugar<<endl;

cout<<"butter cups: "<<num*butter<<endl;

cout<<"flour cups: "<<num*flour<<endl;

return 0;

}

A(n)
I
is something that gives help or aid to a system.
10
11
12 13
1

Answers

Answer:

resource

Explanation:

is something that gives help or aid to a system

Which of the following is the first step considered while creating a chart?
a. Determine the chart layout.
b. Determine the title for the chart.
c. Determine the goal for the chart.
d. Decide the chart type.

Answers

Determine the chart layout

I. Direction: Write TRUE if the statement shows Principles of Facility Planning, and FALSE if
the statement is not.
1. An ideal facility building should serve in achieving the long-term goals of the
organization.
2. An ideal facility building should be unsustainable in long run.
3. A hotel lobby is difficult and cheap to maintain.
4. An ideal facility building should fulfill the needs of the intended user.
5. An ideal facility building should be in harmony with local community & law of the
land.

Answers

The following are either true or false in respect of Principles of Facility Planning/Management.

No.  1 is True. No. 2 is False. No. 3 is False. No. 4 is True. No. 5 is True.

What are the Principles of Facility Planning?

The main principles of facility planning are given below:

The planner must coordinate the plans with other government agencies that provide facilities look at other options before selecting the final location for the facilitygive adequate justification for the proposed facilitydevelop a management plan that includes design priorities and operational strategiesuse the Life-Cycle Cost principles while designing ensure that it is in line with the organisations plans/goals etc

Please see the link below for more about Facility Management:

https://brainly.com/question/5047968

different between computer and other electonic device

Answers

Answer:

Computers have electric motors in them, to run fans, spin disks, etc. ... Other electronic devices are more complex and often made of many more basic devices.

Answer:

You said your camera was not working

Hyperactive Media Sales needs to provide a remote access solution for its traveling salespeople. They have a server running Windows Server 2012 R2 that can be configured as a remote access server for VPN connectivity. You have been reviewing the VPN protocols that are available and need to decide on the best protocol. The traveling salespeople often stay in hotels, so firewall compatibility is a serious concern. Which VPN protocol has the best compatibility with firewalls? Why?

Answers

Answer:

because is a serious concern

define throway protype with examples

Answers

Explanation:

A paper prototype is an example of a throwaway prototype created in the form of rough or hand-sketched drawings of the product's interface, front-end design, and sometimes the back end work.

how do we calculate binary numbers??​

Answers

take the number then divide it by 2 keep dividing the number by 2 untill you get 0 then write the remainders in reverse order

example

we will find the number 12

divide 12 by 2 we get 6 with a remainder of 0

now we divide 6 by 2 we get 3 with a reminder of 0

next we divide 3 by 2 we get 1.5 with a remainder of 1

because we got 1.5 we round down so 1

next we divide 1 by 2 and get -0.5 with a remainder of

1

so the answer is

1100

hope this helps scav

Write a statement that assigns finalValue with the multiplication of userNum1 and userNum2. Ex: If userNum1 is 6 and userNum2 is 2, finalValue is 12.

So far it states:
let number1 = 6; // Code tested with values: 6 and 4
let number2 = 2; // Code tested with values: 2 and -2

let operationResult = 0;

Answers

Assignment statements are used to assign values to variables.

The statement that assigns finalValue with the multiplication of userNum1 and userNum2 is: finalValue = userNum1 * userNum2

How to write the assignment statement

From the question, the variables to be multiplied are

userNum1 and userNum2

The product is to be assigned to finalValue

Hence, the statement that assigns finalValue with the multiplication of userNum1 and userNum2 is: finalValue = userNum1 * userNum2

Read more about assignment statements at:

https://brainly.com/question/16397886

An international fast-food chain is looking for opportunities to leverage the Cloud to gain insights into customer data, including location, and order patterns. The client has engaged Accenture to help create customer-focused experiences, including promotions.

They need Accenture's help with this campaign and to create a unique user experience for all their customers.

Which technology, when partnered with Cloud, would allow this to occur?

Answers

Answer:

Artificial Intelligence

Explanation:

The technology that when partnered with the cloud would allow this to happen is Artificial Intelligence and Machine learning. Artificial intelligence (AI) is an era that allows a device to act like a person.

What is a secured network?
A. not connected to the Internet
B. free of viruses
C. accessible by anyone
D. not open to the public

Answers

Answer:

D) Not open to the public.

Explanation:

Since its not public its secured and safe. Hope this helps! Please mark brainliest!!

if you write a Python command to find the result of: . 1340+1242-43*4
(123-12)*12+14 .
-12*(16/2)+ 13*2​

Answers

Very easy

Program:-

[tex]\tt R1=1340+1242-43*4[/tex]

[tex]\tt R2=(123-12)*12+14[/tex]

[tex]\tt R3=-12*(16/2)+13*2[/tex]

[tex]\tt print(R1,R2,R3)[/tex]

In python,

Write a program that calculates and prints the number of minutes in a year.

Assume the following:

1 year = 365 days (Ignore leap years)
1 day = 24 hours
1 hour = 60 minutes
Below is an example of the correct output format:

The number of minutes in a year is X

Answers

The algorithm given below does not take any parameter to print the number of days in a year, instead all the parameters where statically included as given in the exercise.

//We started by given the function a number with no return type since we //just want to print something

Function To Convert Year to Minutes

def printNumberOfMinutesInOneYear ( ):

   int oneYear = 365;

   int oneDay = 24;

   int oneHour = 60

  int oneYeatInMinutes = oneYear*oneDay*oneHour

   print(The number of minutes in a year is oneYeatInMinutes)

Learn more about Python Programming Language here:

https://brainly.com/question/24661996

________ are created by combining and customizing components from different online software applications.

Answers

Answer:

Mashup are created by combining and customizing components form different online software applications.

what is font formatting ?​

Answers

Answer:

Font formatting. FONT FORMATTING. When your document comprises pages and pages of plain text, it can be very hard for your reader to find the important ideas buried in the page. You can improve the appearance and readability of your document by changing the appearance of the text – this is known as formatting.

Question 2 of 10
Which topic would be included within the discipline of software engineering?
A. Testing and development of apps
B. The fundamentals of computing
C. Development of new computer systems
O D. Integration of business processes
SUBMIT

Answers

The topic would be included within the discipline of software engineering is Testing and development of apps.

What does software engineering made up of?

The Students who are said to focus on software engineering are known to be expected to benefit and get a whole lot of knowledge from a lot of subject areas.

Theses areas includes computer programming, algorithms, numerical methods, design patterns, human-computer interaction, and others.

Learn kore about  software engineering from

https://brainly.com/question/7145033

Answer:

A.

Explanation:

What is the data flow?​

Answers

Answer:

A data flow is a way of representing a flow of data through a process or a system

Evolution of the concepts of quality

Answers

Answer:

The quality concepts were gradually changed from the achievement of quality standards, satisfaction of customer needs, and expectations to customer delight. ... Thus, the concept of “customer delight” and the means to provide the innovative quality so as to meet the unsatisfied customers' latent needs are elaborated on.

Other Questions
Sara has recently been _______ in the gossip columns of several newspapers. A. marred B. maligned C. condoled Define stress and strain. Establish the relation among energy, density stress and strain. Education researchers are interested in the workload expectations of freshmen at a local university. Which of thefollowing techniques would give a stratified random sample?Randomly select 10 freshmen from each of the majors at the universityRandomly select 10 freshmen from the cafeteria on each of the 5 days of the first school week.Randomly select 1 professor at the university and have them survey all of their freshman students.Survey the students in some randomly selected freshman seminar classes, since freshmen are randomly put intothose classes Pythagorean theorem Words Problems Help PLEASEEE!!!Given that AC=30, AB=5x-21, BC=3y+4, CD=2x-3, and DA=4x+1, find the indicated variables for each question. Find the value of x, y, z. 2. In a random sample of 87 college students, the average number of GroupMe messages handled inone day is 49. The 95% confidence interval for the mean number of messages handled by studentsdaily is given as 47 to 51.a. What is the population standard deviation of the sample?b. If the number of samples were doubled, by what factor would the confidence interval change(keeping the same confidence level?) What is one of the major differences between the historical 3-Stage Model of Memory and Connectionist models of memory please help worth 100 pts if f(x) = ax + b where a and b are Costants f(1) = 6and f(-2)=3, find the value of a and b? How can you convert diamond into graphite ? The points (-5, r) and (2, 3) lie on a line with slope 2. Find the missing coordinate r. Choose the polynomial that is written in standard form. 2x2 3x4 10x6 4x4 6x3 10x4 3x8 9x2 10x 7x6 x3 10x8. if x-3 is a factor of 2x^k - 3 x^(k-1) +4x -39 find the value of k. The largest doll is 12 inches tall. The height of each of the other dolls is 7/10 the height of the next larger doll. Write an expression involving a power that represents the height of the smallest doll. What is the height of the smallest doll? A skateboard chsnges velocity from 15 meters per second to 5 meters per second, over the course of 5 seconds. What is the skateboards acceleration?A. -2 m/s^2B. +2 m/s^2 C. +0.5 m/s^2D. -0.5 m/s^2 1 and 5/8 divided by 1/3 thx for your help on the other one now i need help on this one Please help this is due in 20 mins What do you call the sentence that is used to introduce your thirdreason in order to prove the counterclaim wrong? Muscle that allows you to shrug your shoulders or extend your head.