Answer the question
In order to leave comments, you need to log in
What are the means to solve this problem?
Good day, I want to say right away that there is no need to decide for me, I will try to do it myself. All I need is advice, a hint in which direction to go. There is a task, as I understand it, this is a task related to computer graphics. Prior to this, Java worked only with the console, and therefore in a stupor now. Tell me how such tasks are implemented in Java, thank you very much in advance!
Problem I don't know how to solve:
A geometric figure is a star (of the form
https://ru.wikipedia.org/wiki/Star_(geometry) ).
Set by parameters: center coordinates, outer radius, inner radius
and number of "rays".
Implement methods: display, move, scale (see task number 14).
Ideally (part of the task that you can not do) make a method for saving the
figure in svg format.
(*) A geometric figure on a plane is a polygon.
Specified as a set of points (limited by lines drawn from point [0] to [1], from
[1] to [2] and so on, the last line connects point [n-1] to point [0].
Must be implemented methods for calculating the area of a figure (it is easy to find an algorithm
on the Internet), perimeter, moving a figure, calculating a rectangle that
describes a given polygon, as well as scaling a figure vertically and
horizontally relative to the top / bottom / middle and left edge / right / middle of the figure,
as well as display shapes.To
demonstrate the work, implement the display of the shape on the
form.The polygon editor is not required (you can specify the shape in the code or
read from file).
Ideally (part of the task that you can not do) make a method for saving the
figure in svg format.
Answer the question
In order to leave comments, you need to log in
Try using Swing to draw the shape itself. Swing is a library that allows you to create GUIs in Java. You can familiarize yourself with its basics in the book by Kay Horstmann, where everything is chewed in great detail.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question