1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
PtichkaEL [24]
3 years ago
13

Using Matlab programming I need to rotate the line defined by x,y by 45 degrees around 2,2

Computers and Technology
1 answer:
belka [17]3 years ago
4 0

Answer:

% here x and y is given which we can take as

x = 2:2:10;

y = 2:2:10;

% creating a matrix of the points

point_matrix = [x;y];

%  center point of rotation  which is 2,2 here

x_center_pt = x(2);

y_center_pt = y(2);

% creating a matrix of the center point

center_matrix = repmat([x_center_pt; y_center_pt], 1, length(x));

% rotation matrix with rotation degree which is 45 degree

rot_degree = pi/4;      

Rotate_matrix = [cos(rot_degree) -sin(rot_degree); sin(rot_degree) cos(rot_degree)];

% shifting points  for the center of rotation to be at the origin

new_matrix = point_matrix - center_matrix;  

% appling rotation  

new_matrix1 = Rotate_matrix*new_matrix;          

Explanation:

We start the program by taking vector of the point given to us and create a matrix by adding a scaler to each units with repmat at te center point which is (2,2). Then we find the rotation matrix by taking the roatational degree which is 45 given to us. After that we shift the points to the origin and then apply rotation ans store it in a new matrix called new_matrix1.

You might be interested in
How we use an array in c programme
Virty [35]
For storing collection of elements of same data type
8 0
3 years ago
Write a program second.cpp that takes in a sequence of integers, and prints the second largest number and the second smallest nu
Doss [256]

Answer:

The program in C++ is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

   int n;

   cout<<"Elements: ";

   cin>>n;

   vector <int>num;

   int input;

   for (int i = 1; i <= n; i++){        cin>>input;        num.push_back(input);    }

   int large, seclarge;

   large = num.at(0);      seclarge = num.at(1);

  if(num.at(0)<num.at(1)){     large = num.at(1);  seclarge = num.at(0);   }

  for (int i = 2; i< n ; i ++) {

     if (num.at(i) > large) {

        seclarge = large;;

        large = num.at(i);

     }

     else if (num.at(i) > seclarge && num.at(i) != large) {

        seclarge = num.at(i);

     }

  }

  cout<<"Second Largest: "<<seclarge<<endl;

  int small, secsmall;

  small = num.at(1);       secsmall = num.at(0);

  if(num.at(0)<num.at(1)){ small = num.at(0);  secsmall = num.at(1);   }

  for(int i=0; i<n; i++) {

     if(small>num.at(i)) {  

        secsmall = small;

        small = num.at(i);

     }

     else if(num.at(i) < secsmall){

        secsmall = num.at(i);

     }

  }

  cout<<"Second Smallest: "<<secsmall;

  return 0;

}

Explanation:

See attachment for explanation

Download cpp
8 0
3 years ago
What is the simplest way to permanently get rid of a unwanted file
uranmaximum [27]
Delete the file is probably the best way to get rid of a file 

5 0
3 years ago
Read 2 more answers
Choose which three values should replace the blanks in the for loop so that it loops through the numbers: 3 6 9 12 15.
mestny [16]

Answer:

3, <= 15, +=3

Explanation:

Required.

Fill in the gaps

The given code snippet written in Java programming language is an iterative statement that prints from 3 to 15 (both inclusive) with an increment of 3.

This means that, the beginning of the loop is 3 and is represented by i = 3

Also, the end is 15 and this can be represented by i<=15.

This means that all numbers less than or equal to 15 be printed

And the increment is 3.

This can be represented in two ways.

i+=3 or i = i + 3

But as used in the options, we go with i+=3

This means that each interval is separated by 3

So, the loop when filled with the above statements is:

for(int i = 3; i <=15; i+=3)

{

System.out.print(i+" ");

}

7 0
3 years ago
Terry is having a problem with his computer screen. He said the screen looks distorted. When you go to check his monitor, you no
sp2606 [1]

Answer:

C. The computer's resolution has been set too low

Explanation:

When the screen of a system looks distorted and the desktop icons do not appear properly, it's a sign of low screen resolution.

This is often caused by the lack of proper display driver.

To fix this, one need to update the graphic driver. The graphic card is always available on the manufacturer's website for download download of latest drivers.

Also, screen resolution can be changed by performing the following tasks.

1. Goto Control Panel

2. Under Appearance and Personalization, click Adjust screen resolution.

3. Click the drop-down list next to Resolution,

4. Move the slider to the resolution you want

5. Click Apply.

5 0
3 years ago
Other questions:
  • Why should you limit what information is in your digital footprint?
    12·1 answer
  • Assessment timer and count Assessment items Item 6 How many different keys can be used in a single sort? 1 2 3 4
    14·1 answer
  • What is the purpose of netiquette guidelines?
    7·1 answer
  • The File method lastModified() returns
    10·1 answer
  • (2) Design pseudocode for a program that accepts numbers from the user until the special number 555 is entered (you should use a
    12·1 answer
  • What will happen when you run this program?
    13·1 answer
  • Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enou
    7·1 answer
  • Tier 1 networks form the internet ____.​
    15·1 answer
  • Which attributes does not come in tag?
    12·2 answers
  • Between the div tags below, type the code for a link to the second.html page. Use "Go to the Second Page" as the link text
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!