# Grapher In this project we will write a graphing program.

there must be a display window of size (600, 360) containing a grid with the same number of columns and rows (10 in the video). Your program should work correctly with a different size and/or number of partitions.

When you click anywhere on the display window, circle of diameter 10 (henceforth called a node) should be displayed at that point. Nodes from previous clicks should stay on the screen and there should be lines that join each node with the next one (and the last is joined to the first node). There should be no other lines besides these lines (and the grid lines of course).

For example, if the sequence of clicks is:

Time x: (200, 400)

Time x + 20: (300, 300)

Time x + 70: (60, 100)

There should be nodes drawn at the three points and lines from (200, 400) to (300, 300); (300, 300) to (60, 100); and (60, 100) to (200, 400).

IMPORTANT: You may assume that the maximum number of nodes is 100.

The most useful material for this part is compound data, in particular, arrays - and loops.

When an arrow key is pressed, all nodes must move up by 1 unit grid cell distance in corresponding direction.

Let's say the display window is of size (700, 500) such that each column is 35 pixels wide and each row is 25 pixels high.

Let's say the two nodes so far are at (240, 65) and (124, 75)

If the UP key is pressed, the two nodes should move to (240, 40) and (124, 50).

If the DOWN key is pressed (instead of UP key), the two nodes should move to (240, 90) and (124, 100).

If the LEFT key is pressed (instead of UP key), the two nodes should move to (205, 65) and (89, 75).

If the RIGHT key is pressed (instead of UP key), the two nodes should move to (275, 65) and (159, 75).

When you click at any location, the node should be generated at the closest grid intersection point.

The most useful material for this part is compound data.

For each node, calculate the sum of distances of that node from every other node.

The node that has the lowest cumulative distance should be coloured red.

The node that has the highest cumulative distance should be coloured blue.

The most useful material for this part is compound data and functions.

You can pick-up a node (using mousePressed), drag it and drop it (using mouseReleased) to another point. The node must be dropped at the grid intersection point closest to the where the mouse is released.

Going above-and-beyond

Double-clicking at an already existing node should remove the node.

If none of the lines are intersecting (besides adjacent lines having a common point), the whole shape must be filled with colour code (0, 0, 255, 127) (semi-transparent blue).

Each time you press the ENTER key, a new graph is generated. The old graph should still be displayed on the display window.

Submission

You must submit your complete Processing sketch as a single pde file [login to view URL] by the due date.

Constraints

Why do these exist?

You cannot use any extra processing libraries or plugins.

You cannot use any Java libraries or plugins.

You cannot use classes.

You cannot use multiple tabs or multiple files.

You cannot use transformations such as rotate,translate, scale.

You cannot use images.

You must submit a single pde file.

Taidot: Graphics Programming

Tietoa työnantajasta:
( 1 arvostelu ) Campsie, Australia

Projektin tunnus: #21402049

## 3 freelanceria on tarjonnut keskimäärin 144\$ tähän työhön

polarjin2017

Hello? How are you? I am excited to work with you on this project. I have good skills in those. So I think I can help you if you want. I am ready to start work immediately. Thanks. Best regards.

\$155 AUD 3 päivässä
(0 arvostelua)
0.0
HuaLing92sms51

Dear Sir/Madam, Nice to meet you. We are very excited for the opportunity to work with you in accomplishing your goals. We are rotoscoping, rotopainting, wire removal and compositing artists,specialise in After effec Lisää

\$100 AUD 1 päivässä
(0 arvostelua)
0.0
\$177 AUD 3 päivässä
(0 arvostelua)
0.0