Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Creating a programm

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Creating a programm

    Hey guys, I have a big big favor to ask. Im studying in Germany and have to do a programming homework. However programming is not a main part of our lessons and therefore I have received very little knowledge about programming with Java. Nonetheless our teacher expects that we write a full programm which I can understand. Bottom line, I would be very thankful if anyone of you could programm or at least help me programm the following assignment:

    Write a programm that proves, that two straights cut each other in a threedimensional room.

    If someone needs the maths to it I can give them. I would be really thankful if you could help me out here. I would do it myself if I actually knew how, but I simply have no clue at all.

    Thanks in advance.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,400
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: Creating a programm

    This isn't a homework service, and what you're asking for equates to academic dishonest, which we don't tolerate.

    Instead, I suggest you read through the following article and post an SSCCE demonstrating where exactly you're stuck: How to Program (stuck on homework? READ THIS BEFORE POSTING)
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Creating a programm

    This is what I have till now. A friend of mine helped, but now I dont know what to do anymore or how to show that the two straights are actually cutting each other as the math shows.

    class matrix
    {

    public static void main()
    {
    //Initialisierung von 4 Vektoren
    double[] s1 = new double[3] ;
    double[] s2 ;
    double[] r1 ;
    double[] r2 ;

    //Eingabe der Vektoren
    // "Bitte Vektoren eingeben"
    System.out.println("text") ;

    s1[0] = system.in.read();
    s1[1] = get();
    s1[2] = get();
    s2[0] = get();
    s2[1] = get();
    s2[2] = get();
    r1[0] = get();
    r1[1] = get();
    r1[2] = get();
    r2[0] = get();
    r2[1] = get();
    r2[2] = get();

    double[][]m = new double [3][3];

    m[0][0] = r1[0];
    m[0][1] = r1[1];
    m[0][2] = r1[0];
    m[1][0] = -r2[0];
    m[1][1] = -r2[1];
    m[1][2] = -r2[2];
    m[2][0] = s2[0]-s1[0];
    m[2][1] = s2[1]-s1[1];
    m[2][2] = s2[2]-s1[2];

    m[0][1] = m[0][1]-(m[0][0]*m[1][2]/m[0][2]);




    }

    }

Similar Threads

  1. Can't run Game of Life programm
    By cutekill0 in forum What's Wrong With My Code?
    Replies: 24
    Last Post: September 13th, 2011, 08:30 AM
  2. Creating and implementing class for creating a calendar object
    By kumalh in forum Object Oriented Programming
    Replies: 3
    Last Post: July 29th, 2011, 08:40 AM
  3. im in a hurry!!Help with a programm..java game of guessing a word
    By mr_doctor in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 13th, 2010, 08:17 AM
  4. Replies: 1
    Last Post: May 3rd, 2010, 01:03 PM
  5. creating a gui
    By rsala004 in forum AWT / Java Swing
    Replies: 2
    Last Post: July 21st, 2009, 02:17 AM