Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
simple 2d plot
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
spectre  
View profile  
 More options Mar 18 2012, 9:02 am
From: spectre <enricopasso...@gmail.com>
Date: Sun, 18 Mar 2012 06:02:31 -0700 (PDT)
Local: Sun, Mar 18 2012 9:02 am
Subject: simple 2d plot

Hi,

I'm using freemat under linux and it works perfectly.I'm a newbie,so sorry
for my banal? question

I want to plot something like this,is it possible ? Let me to explain:

I have an x,y point on my 2d space, For example x=10, y=10;
using the following:

x' = x*cos(angle) - Y*sin(angle)
x' = x*sin(angle) + Y*cos(angle)

I can find the x' and y' coordinates.

All I want to do with Freemat is to plot something like the fig1
Is it possible? (for sure) Can you help me ?

best regards
Spectre
*
*

<https://lh5.googleusercontent.com/-xyuXOCwWLF0/T2XcILrbE1I/AAAAAAAAAb...>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Timothy Cyders  
View profile  
 More options Mar 18 2012, 1:15 pm
From: Timothy Cyders <t.cyd...@gmail.com>
Date: Sun, 18 Mar 2012 13:15:47 -0400
Local: Sun, Mar 18 2012 1:15 pm
Subject: Re: simple 2d plot

I'm not perfectly sure what you're asking, but perhaps this will help.
At the console, you can make a vector of x values using the colon notation:

x = 0:0.1:1;

This makes the variable x a vector starting at zero, increasing by 0.1
to a final value of 1. You can then assign y values like so:

y = x*sin(pi/12);

Then, simply plot the two vectors:

plot(x,y);

TJ

On 3/18/2012 9:02 AM, spectre wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Yoepp  
View profile  
 More options Mar 18 2012, 6:10 pm
From: John Yoepp <john.yo...@gmail.com>
Date: Sun, 18 Mar 2012 18:10:27 -0400
Local: Sun, Mar 18 2012 6:10 pm
Subject: Re: simple 2d plot

Specter,
I think you want to draw all of figure 1,
including the blue rotated vector and the green arc.
Yes?
Do you also want the point coordinate annotations
(X,Y) and (X',Y')?
Your second formula should be y', not x'.

John Yoepp, PhD
Math, Algorithms, MATLAB
Consulting and Training

On Mar 18, 2012, at 1:15 PM, Timothy Cyders <t.cyd...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Weaver  
View profile  
 More options Mar 19 2012, 10:11 am
From: Jonathan Weaver <jonathan.wea...@windstream.net>
Date: Mon, 19 Mar 2012 07:11:47 -0700 (PDT)
Local: Mon, Mar 19 2012 10:11 am
Subject: Re: simple 2d plot

Spectre,

This will plot something like figure 1 without the annotation.

%Define First line, each column is a point, first row is x, second row is y

len = 1;

line1 = [0 len; 0 0];

%Define angle and rotation matrix to calculate x and y together

angle = pi/2/4;

rotMatrix = [cos(angle) -sin(angle); sin(angle) cos(angle)];

%Rotate it

line2 = rotMatrix*line1;

%Rotate it

line3 = rotMatrix*line2;

%Plot the lines, splitting each row into x and y

hold on;

plot(line1(1,:),line1(2,:));

plot(line2(1,:),line2(2,:));

plot(line3(1,:),line3(2,:));

%Define and plot the arc

a = 0:angle/100:angle*2;

plot(len*cos(a), len*sin(a));

%Set the limits on the X and Y for looks

xlim([-0.5*len,1.5*len]);
ylim([-.5*len,1.5*len]);

Is that what you're looking for?

-Jonathan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »