Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3281826
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:51:33+00:00 2026-05-17T19:51:33+00:00

There is task to implement some triangle class with interface like this public interface

  • 0

There is task to implement some triangle class with interface like this

public interface Triangle  {
    void moveApex(Point from, Point to);
    List<Point> getApexes();
    void rotate(double angle);
    void setLocation(Point p);
    Point getLocation();
    void setSize(Dimension d);
    Dimension getSize();
}

Where Point and Dimension are some pairs of integers. In what way would you implement it? Would you creates some fields with Apexes or you will operate with 2 angles and one base line or smt else?
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:51:34+00:00Added an answer on May 17, 2026 at 7:51 pm

    Points can – as you mentioned – be represented as a pair of points. Let’s call such a pair a 2-dimensional vector. A vector can be interpreted as an arrow from the origin (of your coordinate system) to a point or just as an arrow starting anywhere indication a direction or movement. I.e. a vector is a representation for both a single point and a movement.

    Thus, you can define a Triangle using vectors. Vectors can be transformed via 2×2-dimensioal arrays of numbers called matrices. With the help of these matrices, arbitrary transformations can be expressed nicely.

    Here are some links that could help you and give more detailed information.

    Vectors: http://en.wikipedia.org/wiki/Euclidean_vector

    Triangle overview: http://en.wikipedia.org/wiki/Triangle

    Matrix overview: http://en.wikipedia.org/wiki/Matrix_multiplication

    Rotation via matrices: http://en.wikipedia.org/wiki/Rotation_matrix

    • setLocation requires vector movement (i.e. vector addition)
    • setSize might require vector multiplication
    • rotate Implement matrix rotation

    So please read the above links, and just convert the maths to Java. The maths itself isn’t that complicated so it should be possible to do so without much difficulty.

    Of course there are supposedly plenty of implementations around.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to implement a Rake task that automates some of the tasks
I have the following task: there are a simple table from mysql database: <html>
Is there an equivalent of the Visual Studio Task List in MS Access? I'd
Is there a way except the sshexec task to do this? I know that
I need to build a Swing GUI like this GUI Mockup http://img199.imageshack.us/img199/7271/mockupl.png where there
I have some code where the timer EventHandler has this void timer_Tick(object sender, EventArgs
I'm looking for some advice on the best way to implement the task below
I would like to execute some task after a user request in background. My
I am trying to implement some kind of background task queue in Django, because
I'm approaching a task of Bio Informatics, and need to extract some features from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.