Math.sin

I am asked to create a program that takes an angle in degrees convert it into radians and give the sin cos and tan of the angle
I am unfamiliar with these methods and unsure how to set the method up
I have looked up the method details for all methods such as
sin
{code}public static double sin(double a){code}
I still do not have any clue, I do not want just an answer, I would rather be guided somewhere that I can figure this out on my own.
I try to look up the classes and methods on java but i just dont understand, this is my second java class and it still seems like a different lanuguage.
THanks for any help

a couple of corrections but I think this is perfect
the last code i posted after i converted to radians i still used my degree varible to detrimine my cos, sin, and tan
so i fixed it to use the converted radians
     public static void main(String[] args) {
          // Initialize variables
          double angdeg = 0;
          double csin = 0;
          double ccos = 0;
          double ctan = 0;
          double rad = 0;
          // User Input
          Scanner kb = new Scanner(System.in);
          System.out.print("Enter The Angle in Degrees");
          angdeg = kb.nextDouble();
          // Calculations
          rad = Math.toRadians(angdeg);
          csin = Math.sin(rad);
          ccos = Math.cos(rad);
          ctan = Math.tan(rad);
          // Output
          System.out.printf(" Angle (degs): %4.4f\n Angle (rads):  %6.4f\n Sine: %15.4f\n Cosine: %13.4f\n Tangent: %12.4f\n", angdeg, rad, csin, ccos, ctan);
}

Similar Messages

  • Math.sin(Math.PI)

    It's a circular pre-loader. When I add the "SecondHalf" the preloader doesn't work and gives an error saying the script is causing the flash player to run slowly. How can I fix this?
    This code is in:  _root.first_mc._second_mc
    previewImage.onLoadProgress = function(targetMC, lBytes, tBytes) {
    //FirstHalf
    //This works only without "SecondHalf"
              percentDone=Math.round((lBytes / tBytes) * 100);
              _root.loaderPsnt_tx.percentDisplay.text = percentDone + "%";
    //SecondHalf
    //This is not working
          _root.mc_mask.clear();
          _root.mc_mask.beginFill(0xff0000, 100);
          _root.mc_mask.lineStyle(1, 0xff0000, 80);
          for (i=0; i>=c; i--) {
             x = Math.sin(Math.PI/90*i)*mask_ra;
             y = Math.cos(Math.PI/90*i)*mask_ra;
             _root.mc_mask.lineTo(x, y);
          _root.mc_mask.endFill();
          c = Math.round(percentDone * (-1.84));
    previewImage.onLoadStart = function(targetMC) {
              _root.loaderPsnt_tx._visible = _root.circle._visible = _root.mc_mask._visible = true;
              _root.circle.setMask(_root.mc_mask);
              var mask_ra:Number = (_root.circle._width / 1) * -1;
              var c:Number = 0;
              var percentDone:Number = 0;
    previewImage.onLoadComplete = function(targetMC) {
              _root.loaderPsnt_tx._visible = _root.circle._visible = _root.mc_mask._visible = false;

    mask_ra is undefined in onLoadProgress.
    use:
    var mask_ra:Number;
    previewImage.onLoadProgress = function(targetMC, lBytes, tBytes) {
    //FirstHalf
    //This works only without "SecondHalf"
              percentDone=Math.round((lBytes / tBytes) * 100);
              _root.loaderPsnt_tx.percentDisplay.text = percentDone + "%";
    //SecondHalf
    //This is not working
          _root.mc_mask.clear();
          _root.mc_mask.beginFill(0xff0000, 100);
          _root.mc_mask.lineStyle(1, 0xff0000, 80);
      c = Math.round(percentDone * (-1.84));
          for (i=0; i>=c; i--) {
             x = Math.sin(Math.PI/90*i)*mask_ra;
             y = Math.cos(Math.PI/90*i)*mask_ra;
             _root.mc_mask.lineTo(x, y);
          _root.mc_mask.endFill();
    previewImage.onLoadStart = function(targetMC) {
              _root.loaderPsnt_tx._visible = _root.circle._visible = _root.mc_mask._visible = true;
              _root.circle.setMask(_root.mc_mask);
             mask_ra = (_root.circle._width / 1) * -1;
              var c:Number = 0;
              var percentDone:Number = 0;
    previewImage.onLoadComplete = function(targetMC) {
              _root.loaderPsnt_tx._visible = _root.circle._visible = _root.mc_mask._visible = false;

  • Math.sin() problem

    Hi!
    I need calculating sin in java but i need it in degrees and java doing it in rads. Anybody knows what can i do?
    Thanx!!!
    Max

    Maybe you should look through the API at that Math class. You're already using Math.sin() ... how could you have missed Math.toDegrees() and Math.toRadians() ???

  • Math.cos Math.sin = Math.HELP

    Hello Everyone,
    I was hoping to create a JS script to move objects away from common center based upon their current position. I was thinking to use a single selected path item as the center based on its position x/y and width/height. Using this reference point the script would then move away all other path items from this center point based on a desired amount and with uniform increments given their current location from this center. I was thinking cos and sin would be my friend in this case, however they seem to have become my foe instead. ;-)
    Does this sound doable? What am I missing, doing wrong, misinterpreting? Below is a non-working attempt, I can't seem to sort things out, perhaps I was close and missed it or maybe I am super way off and its more complex than I thought. However at this point I am confused across my various failed attempts this only being one of them.
    Thanks in advance for any assistance and sanity anyone can provide.
    // Example failed code, nonworking concept
    var docID = app.activeDocument;
    var s0 = docID.selection[0];
    pID = docID.pathItems;
    var xn, yn;
    var stepNum = 20;
    for (var i = 0; i < pID.length; i++) {
        var p = pID[i];
        var dx = ((s0.position[0] + s0.width) / 2 - (p.position[0] + p.width) / 2);
        var dy = ((s0.position[1] + s0.height) / 2 - (p.position[1] + p.height) / 2);
        xn = Math.cos(Number(dx) * Math.PI / 180)+stepNum;
        yn = Math.sin(Number(dy) * Math.PI / 180)+stepNum;
        var moveMatrix = app.getTranslationMatrix(xn, yn);
        p.transform(moveMatrix);
        stepNum+=stepNum;

    Hi W_J_T, here's one way to do what I think you want to do, I commented out the step increment so all items will "explode" the same distance, not sure if that's what you need.
    first I'd move the calculation of the Selected object's center out of the loop, you only need to make the math once.
    also, (s0.position[0] + s0.width) / 2  has a problem, it will not give you the center, check below
    // calculate Selection center position
    var cx = s0.position[0] + s0.width/2;
    var cy = s0.position[1] + s0.height/2;
    then we're going to loop thru all items and calculate their center
            // calculate pathItem's center position
            var px = p.position[0] + p.width/2;
            var py = p.position[1] + p.height/2;
    we're going to skip calculating the distance from the selection's center to each item's center, we don't need it for this method, other methods could use this info.
    now, your actual question about Sin/Cos
    xn = Math.cos(Number(dx) * Math.PI / 180)+stepNum;
    sin(angle) and cos(angle) expect angles in Radians, you are not providing any angles in the formula above. We need to calculate the angle between Selection's center and each path's center
            // get the angle formed between selection's center and current path's center
            var angle = get2pointAngle ([cx,cy], [px,py]);
    once we have the angle we can apply it to our "Explosion" variable, I'm assuming is stepNum, and get its x and y distance it needs to move away from selection
            // the distance to move is "stepNum" in the same direction as the angle found previously, get x and y vectors
            var dx = stepNum*Math.cos(angle);// distance x
            var dy = stepNum*Math.sin(angle);// distance y
    all is left to do is move the paths, here's the whole thing
    // Explosion, AKA move all items away from selection
    // carlos canto
    // http://forums.adobe.com/thread/1382853?tstart=0
    var docID = app.activeDocument;
    var s0 = docID.selection[0];
    pID = docID.pathItems;
    var stepNum = 20; // this is the distance to "explode"
    // calculate Selection center position
    var cx = s0.position[0] + s0.width/2;
    var cy = s0.position[1] + s0.height/2;
    for (var i = 0; i < pID.length; i++) {
        var p = pID[i];
        // skip selected item
        if (!p.selected) {
            // calculate pathItem's center position
            var px = p.position[0] + p.width/2;
            var py = p.position[1] + p.height/2;
            // get the angle formed between selection's center and current path's center
            var angle = get2pointAngle ([cx,cy], [px,py]);
            // the distance to move is "stepNum" in the same direction as the angle found previously, get x and y vectors
            var dx = stepNum*Math.cos(angle);// distance x
            var dy = stepNum*Math.sin(angle);// distance y
            var moveMatrix = app.getTranslationMatrix(dx, dy);
            p.transform(moveMatrix);
            //stepNum+=stepNum;
    // return the angle from p1 to p2 in Radians. p1 is the origin, p2 rotates around p1
    function get2pointAngle(p1, p2) {
        var angl = Math.atan2(p2[1] - p1[1], p2[0] - p1[0]);
        if (angl<0) {   // atan2 returns angles from 0 to Pi, if angle is negative it means is over 180 deg or over Pi, add 360 deg or 2Pi, to get the absolute Positive angle from 0-360 deg
            angl = angl + 2*Math.PI;
      return angl;

  • Using java.lang.Math.sin/tan/cos  to make an arc - very simple

    hi all,
    i'm trying to dynamically create an set of numbers in an arch pattern -- going left to right (counter clockwise) --- from 0 degrees to 180 degrees. -- similar to an upside down U
    Any ideas on how i would do a simple loop to put the number 1 in a semicircle.
    I'm guessing that it might look like this
    while(x < 181)
    g.drawString(Integer.toString(x) , java.lang.Math.sin(..), java.lang.Math.cos(...) )
    how may I ask does that work again ?
    s

    The coordinates of the unit circle are given by
    x = cos(t)
    y = sin(t)
    where 0 < t <= 2pi
    You'll want to scale and translate that... Here's a code fragment; play with it a little:for (double t=Math.PI/2; t < 2*Math.PI, t += .05) {
        double x = 100*Math.cos(t) + 100;
        double y = 100*Math.sin(t) + 100;
        g.drawLine((int) x, (int) y, (int) x, (int) y);
    }

  • Cosine/Sine problems

    I was writing some code for a simple game, and at the moment the focus is getting the character to move. To "strafe" to the right, I have used the following method:
    public void moveRight() {
              double tempAngle = horizAngle - 90.0;
              location.setX(location.getX() + (Math.cos(tempAngle) * runSidewaySpeed));
              location.setY(location.getY() + (Math.sin(tempAngle) * runSidewaySpeed));
    }I used the following values for the first test:
    double horizAngle = 0.0
    double runSidewaySpeed = 2.0
    And I centered the Location on (0, 0), the origin. If you do the math, activating this method should change the location to (0, 2). It does not, however. Instead it moves the character in the correct Y direction, but not far enough, and in the negative direction of the X, which isn't supposed to move at all.
    I looked through the code, and I found the glitch. From what I've learned the Cosine of -90 (tempAngle's value) is 0. But when I use a System.out.println to check it, the program reveals that the cosine of -90 is -0.44807... Sine returned the same result.
    What am I doing wrong? Or if there really is a problem with the Math.sin() / Math.cos(), and if so, can someone suggest an alternative?
    EDIT: Never mind, I discovered my problem. The Cosine/Sine methods take radians, not degrees. The API is sort of deceiving.
    "Returns the trigonometric cosine of an angle."
    Message was edited by:
    Goron40

    EDIT: Never mind, I discovered my problem. The
    Cosine/Sine methods take radians, not degrees. The
    API is sort of deceiving.
    "Returns the trigonometric cosine of an angle."How is that decieving? This is what it says:
    cos
    public static double cos(double a)
        Returns the trigonometric cosine of an angle. Special cases:
            * If the argument is NaN or an infinity, then the result is NaN.
        The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
        Parameters:
            a - an angle, in radians.
        Returns:
            the cosine of the argument.Seems pretty clear to me.

  • Math for looking up and down in 3d world

    Hello,
    I have a float called "heading" which is how much the player has turned (around the y axis) and a float called "verticalLook" which is how much the player has started to turn his head upward towards the sky.
    I call
    gl.glRotatef(360.0f - heading,0,1.0f,0);//this correctly rotates the user about the y-axis.Then, I call:
    gl.glRotatef(verticalLook,(float)(Math.cos(heading*TO_RADIANS)*TO_DEGREES),0,
                     (float)(Math.sin(heading*TO_RADIANS)*TO_DEGREES));This produces weird results. I tried switching the sin and cos and it still didnt work. I know that to vertically look up, it will have to be rotated about a combination of the x and z axis, but I'm trying to figure out the formula.
    Thanks

    hello Datta,
    thanks for you quick reply, these one you sent me are for allowing the end user to actually be able to use the scroll track ball in a mouse, just the same way it works in Excel or Word?
    thanks again, i will test them shortly.
    JD

  • Graphs and Maths

    not got a clue about this probably very easy thing so pleeeeeease help me.
    i have to make a graph which displays "y=A*sin(x)+B*cos(X)" where i can select diferent values for a and b. how am i supposed to do this? what do i use? i dont even know where to start so even the basics will do. cheers 4 any help.

    This topic is absolutelly not for a java begginer. It should match more to a somewhat advanced "computer graphics in java" course. Anyway, you need a component to draw into (a Canvas for example). Its paint method should look something like this:
    public void paint(Graphics g){
    //draw the label
    g.setColor(Color.black);
    Dimension d = this.getSize();
    String lab = " y = "+a+"*sin(x) + "+b+"*cos(x)";
    g.drawString(lab,50,20);
    //draw the axes
    g.drawString("y",60,45);
    g.drawString("x",d.width-60,d.height-40);
    g.drawLine(50,50,50,d.height-50);
    g.drawLine(50,d.height/2,d.width-50,d.height/2);
    double maxx = d.width-140;
    //draw the curve
    g.setColor(Color.red);
    for(x=0.0; x<2*Math.PI; x+=0.01){
         y = a*Math.sin(x) + b*Math.cos(x);
         int x1 = (int)((x*maxx/(2*Math.PI))+50);
         int y1 = (int)(d.height/2 - y*125);
         g.drawLine(x1,y1,x1,y1);
    .....assuming that you have initialized somehow the values of a and b...
    Good luck....

  • How do I fix slight distortion in background in generating sine wave

    I'm getting a slight distortion in the background when I run the following code, the distortion is very slight and sounds like buzzing. Because of its subtle nature it makes believe there is some sort of aliasing going on with the byte casting:
    Note: code assumes (for now) that the data is in big endian.
    Output:
    PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian
    (sound)
         public static void playFreq(AudioFormat audioFormat, double frequency, SourceDataLine sourceDataLine)
              System.out.println(audioFormat);
              double sampleRate = audioFormat.getSampleRate();
              int sampleSizeInBytes = audioFormat.getSampleSizeInBits() / 8;
              int channels = audioFormat.getChannels();
              byte audioBuffer[] = new byte[(int)Math.pow(2.0, 19.0) * channels * sampleSizeInBytes];
              for ( int i = 0; i < audioBuffer.length; i+=sampleSizeInBytes*channels )
                   int wave = (int) (127.0 * Math.sin( 2.0 * Math.PI * frequency * i / (sampleRate * sampleSizeInBytes * channels) )  );
                   //wave = (wave > 0 ? 127 : -127);
                   if ( channels == 1 )
                        if ( sampleSizeInBytes == 1 )
                             audioBuffer[i] = (byte) (wave);
                        else if ( sampleSizeInBytes == 2 )
                             audioBuffer[i] = (byte) (wave);
                             audioBuffer[i+1] = (byte)(wave >>> 8);
                   else if ( channels == 2 )
                        if ( sampleSizeInBytes == 1 )
                             audioBuffer[i] = (byte) (wave);
                             audioBuffer[i+1] = (byte) (wave);
                        else if ( sampleSizeInBytes == 2 )
                             audioBuffer[i] = (byte) (wave);
                             audioBuffer[i+1] = (byte)(wave >>> 8);
                             audioBuffer[i+2] = (byte) (wave);
                             audioBuffer[i+3] = (byte)(wave >>> 8);
              sourceDataLine.write(audioBuffer, 0, audioBuffer.length);
         }

    The data was actually LITTLE-endian, it become apparent when you use a larger amplitude (say 2^15).

  • Sin/cos

    hey I need my program to run faster and I used to just have sin/cos tables to get values from but I need more accuracy than that. However, I dont think I need as much accuracy as the built in java functions give. I forget the exact formula for it.. its something like 1+e^3/3!+e^5/5! etc.. does anyone know how far the java function goes?

    Don't bother writing your own trigonometric functions. If you think your program runs slower by calling them (and my guess is that you haven't tested that hypothesis yet), then just make a lookup table. Have entry 0 contain the sine of 0, entry 1 contain the sine of 0.01 (radians), and so on up to entry 628 containing the sine of 6.28 radians. This table of 629 entries covers the entire circle. You can fill in this table while your program is loading by calling the regular Math.sin method.
    Then when you need to calculate the sine of an angle, round it to the nearest 0.01 radians, multiply by 100, and use that integer as an array index to get the sine.

  • X^2 to Math.pow(x,2)

    I am writing a program that takes an argument equation and calculates a Riemann sum. I've got the bulk of the coding written. I have no problem converting any type of trig functions in the argument to their proper string representations of the java.lang.Math class and method, ie if user enters sin(x)/cos(x), the program converts it to a string of Math.sin(x)/Math.cos(x). However, when I try to convert x^2 (x squared) to Math.pow(x,2), the computer just leaves it as it is. This is the code i've tried so far:
    args[0] = sin(x)/cos(x)  // user input at command line
    args[0].replaceAll("sin","Math\u002Esin");
    args[0].replaceAll("cos","Math\u002Esin");However, when I try the same with x^2 as input, even with the unicode instead of a carat, the output is still just x^2. Any idea how I can get a string of x^2 converted to Math.pow(x,2) ?

    then you're going to need a regular expression
    something
    like.replaceAll("(.*)x\\^([0-9]).*(.*)", "\\1
    Math.pow(x, \\2) \\3")
    Solved the problem with
    for(int i = 0; i < 10000; i++){
       s = s.replaceAll(String.format("x\\^"+i),String.format("Math\u002Epow("+i+")") );
    }covers integer exponents up to 10000, and barely noticeable increase in calculation time. thanks to all for the help!

  • Add the Math functions

    Hello there
    Can any one tell what the syntax is for adding the Math.Sin(),Math.Cos()and Math.Tan() functions to an interface as buttons.
    I tried key[] = new Button("Cos");
                   key[].addActionListener(this);
                   key[].setBounds(150,250,BWIDTH + 5,BHEIGHT);
                   key[].setBackground(Color.lightGray);
                   frame.add(key[]);
                   frame.setVisible(true);
    Just to add the button without functionality.
    There were no compilatiion error with this but the button is not visible
    Anyone see why?
    Do you use a registered name
    eg
    Math.cos = new Button("Cos");
    Thanks in advance

    Uhhhhh... Frankly, I didn't understand what do you want to do here. Do you want to make the button calculate the value of the Math methods? Any chance I get to see more code?

  • Math trouble ! Help !

    I try to calculate all the points on a curve.
    The curve decided by the width(X on the picture) and height(Y on the picture) properties of a movieclip.
    The distance between each green point on curve is the same.

    I think dealing with ellipse or bezier in this context is too cumbersome and pretty imprecise.
    Code below accomplished drawing interface you want and positions point at equal intervals along the curve.Just make this class a document class.
    Read comments:
    package
         import flash.display.GradientType;
         import flash.display.Graphics;
         import flash.display.Sprite;
         import flash.geom.Matrix;
         public class ObjectCurve extends Sprite
              private var container:Sprite;
              // container width
              private var w:Number = 500;
              // container height
              private var h:Number = 400;
              // reusable Graphics reference
              private var g:Graphics;
              public function ObjectCurve()
                   init();
              private function init():void
                   // make container
                   container = new Sprite();
                   g = container.graphics;
                   with (g) {
                        beginFill(0xEBEBEB);
                        drawRect(0, 0, w, h);
                        endFill();
                   container.x = container.y = 50;
                   addChild(container);
                    * diagonal is base of right triangle that is made of
                    * two radiuses
                    * IMPORTANT! Center of cricle is positined at x = width of container
                    * and y = radius.
                    * radius is most important value to calculate fro this functionality
                    * it depends on, again, container dimensions
                   // length of container diagonal
                   var diagonal:Number = Math.sqrt(w * w + h * h);
                   // angle of container diagonal
                   var diagonalAngle:Number = Math.atan2(h, -w);
                   // radius of the circle which will be used for calculating anlges.
                   var radius:Number = diagonal * .5 / Math.sin(diagonalAngle);
                   // angle between left buttom corner of container and center of circle
                   var angle:Number = Math.atan2(h - radius, -w);
                   // angle between radiuses
                   var radAngle:Number = -(angle - ( -90 * Math.PI / 180));
                   // length of arc that will be drawn
                   var arcLength:Number = radAngle * radius;
                   // radian increment for each roation
                   var rotationIncrement:Number = radAngle * 4 / arcLength;
                   // prepare for gradiwnt fill
                   var matrix:Matrix = new Matrix();
                   matrix.createGradientBox(w, h, -45 * Math.PI / 180);
                   var colors:Array = [0x000000, 0x4646FF];
                   var alphas:Array = [1, 1];
                   var ratios:Array = [0x00, 0xFF];
                   // draw arc
                   g = container.graphics;
                   g.lineStyle(2, 0xFFFF00);
                   g.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
                   g.moveTo(0, h);
                   while (angle < -90 * Math.PI / 180) {
                        g.lineTo(w + radius * Math.cos(angle) , radius + radius * Math.sin(angle));
                        angle += rotationIncrement;
                   // finish to top right corner
                   g.lineTo(w, 0);
                   // continue drawing to make borders
                   g.lineTo(w, h);
                   g.lineTo(0, h);
                   // place points at equal intervals
                   // number of points
                   var numPoints:int = 10;
                   // number of segments based on number of points
                   rotationIncrement = radAngle / numPoints;
                   // return angle to its original value
                   angle = Math.atan2(h - radius, -w);
                   var point:Sprite = drawPoint();
                   // place first point at the beginning of arc
                   point.x = w + radius * Math.cos(angle);
                   point.y = radius + radius * Math.sin(angle);
                   container.addChild(point);
                   // create and place other points
                   for (var i:int = 0; i < numPoints; i++) {
                        angle += rotationIncrement;
                        point = drawPoint();
                        point.x = w + radius * Math.cos(angle);
                        point.y = radius + radius * Math.sin(angle);
                        container.addChild(point);
              private function drawPoint():Sprite {
                   var s:Sprite = new Sprite();
                   s.graphics.beginFill(0x00FF00);
                   s.graphics.drawCircle(0, 0, 5);
                   return s;

  • Can fdlibm (native math library) be replaced?

    Looking at the jdk1.4.1 source code java.lang.Math class delegates most of its calls to java.lang.StrictMath. According to the documentation, the native calls in StrictMath are done in fdlibm. Does anyone know where/how fdlibm is loaded? Is this library accessed via JNI or some other jvm-specific mechanism? The reason why I am asking this is because I would like to replace fdlibm by a different (much faster) math library without incurring JNI method call overhead. Is this possible or am I stuck using my own native math library accessed via JNI? On my system, using the system native math library (libm), the time required to calculate sin(x) is about the same as the JNI method call overhead?
    Thanks,
    Dale

    Just because the source for java.lang.Math appears to delegate the calculation to StrictMath, doesn't mean that the JVM actually does this. It can easily replace these methods with something else provided that the specification is observed. It is clear from timing the calls that Math.sin is faster than StrictMath.sin although still significantly slower than the Intel FSIN instruction. The Math code appears to be reducing the argument range to +-PI/4 using the technique used in fdlibm and then using FSIN on this reduced range.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Rotating, need help with cos, and sin.

    I was reading through the fourmns and have learned that I need to convert to degrees. How do I do that? another issue is, the lines are plotted with INT values and can only be int. How do I do this with ints.
    Actually, I have a scale funtion I would like to be float, but the drawRect only accepts ints. Any way of doing this.
    Here is my code. How do I do this properly.
    thanks
    //gets the new points for the rotation. passing in degrees
         public int [] rotation(int vx, int vy, int d, Graphics g)
         //using this to pass the points I need to main
         int [] tp = new int [2];
             //[row] [col]
         int[][] TM = {{Math.cos(d),-Math.sin(d), 0},
                    {Math.sin(d), Math.cos(d), 0},
                    {       0,         0,        1}}; 
             int [][] Op ={{ vx, vy, 1}};
             int [][] TD = new int [1][3];
             //gets the X + TX // Y +TY and 1 value
             TD[0][0] = Op[0][0]*TM[0][0] + Op[0][1]*TM[0][1] + Op[0][2]*TM[0][2];   // {{TX}
             TD[0][1] = Op[0][0]*TM[1][0] + Op[0][1]*TM[1][1] + Op[0][2]*TM[1][2];  //   {TY}
             TD[0][2] = Op[0][0]*TM[2][0] + Op[0][1]*TM[2][1] + Op[0][2]*TM[2][2]; //    {1 }   
             //holds the new cordinate to plot using this cause I dont need the 1
             tp[0] = TD[0][0];
             tp[1] = TD[0][1];
           return tp;
        }

    yeah, here is an example the teacher had. His had 0, and 1's. Im not really sure about it.
    Every math teacher I had skipped trig stuff and cos, sin.
                                                                                              why again?
    | cos90    -sin90      0  |         | 100 |        0  -1   0     |100|      -200
    | sin90      cos90      0 |         | 200 |   =  1   0   0      |200|   =  100
    |   0                0          1  |         |   1   |         0  1    1     |  1   |          1yikes, nothing lined up!! sorry about that. Not sure how to fix it with this little window for edit.
    reilley35

Maybe you are looking for

  • How can I keep the column names in view on long spreadsheets?

    I want to be able to see the column header names on long spreadsheets. In Excel you can create multiple panes in the window so as to keep both column and row headers in view. Any way to do this in numbers?

  • A screen for my stomach

    hi, when i use my iBook, it's almost always resting on my chest/stomach while i recline at about a 30 degree angle. i just like to read online articles with some coffee when i get home from work, and i don't have a desk or a table (i have a convertib

  • Manually comparing Page items from two versions of an application?

    Hi folks, I have two separate applications, one being an older version of the other. Is there a way to query the APEX metadata on a per page item basis to check for any small changes between items, or which items exist on one but not the other?

  • Developer key for creating BPC reports

    Hi, Do we need a developer key for creating BPC reports in EPM ADD IN Excel or Web interface? I do not believe so but wanted to confirm. Sincerely, Nicky

  • Epson 2200 printer options missing in Leopard

    I've just spent almost an hour with Apple Support and they were not able to help with this issue, despite the fact that a quick Google search shows that I'm not the only person with this problem. I'm using the most recent Epson drivers from the Epson