# A quick question about the 1st chapter of Processing

**URL:** <https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230>\
**Category:** Beginners\
**Created:** [July 13, 2021, 10:55am UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230 "2021-07-13T10:55:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peace](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@Peace](https://discourse.processing.org/u/Peace)\
**Post date:** [July 13, 2021, 10:55am UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230/1 "2021-07-13T10:55:53Z")

</div>

Can anybody also please help me with my following query ? In the page 6 of the Processing textbook, a line has been drawn ( as can be seen in the attached picture Figure 1-6) on a graph paper and I can’t understand how the writer got the line numbers ( 1,3 , 8, 3 ) from Point A to Point B ? Neither do I understand how did the writer got those numbers in Figure 1-7 of the page 6.

 ![IMG_20210713_204059](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/94fe8d4fb366a7464a372e234bab4f77212b65d0.jpeg)

It’s been a while I studied grap and as result can’t remember anything about graph !!!

Any help will be greatly appreciated. Thanks heaps 🙂

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [July 13, 2021, 11:01am UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230/2 "2021-07-13T11:01:04Z")

</div>

Yeah pretty much the columns are numbered in x direction and the rows/lines are numbered in y direction.

Similar to a Chess board you can therefore define a point by its column and row. Where those two meet is your point.

**LINE**

Two points x,y make a line

x1,y1 TO x2,y2

For a rectangle we specify the point upper left corner again as `column number , row number`.

The next two parameters specify `width and height` of the rectangle in pixels

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 13, 2021, 11:11am UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230/3 "2021-07-13T11:11:02Z")

</div>

Hello,

Check out the resources (tutorials, references. examples) available here:  
_[https://processing.org/](https://processing.org/)_

There is a good tutorial here:  
_[Coordinate System and Shapes \ Processing.org](https://processing.org/tutorials/drawing/)_

There is also the Coding Train on YouTube… there may be a good tutorial there.

`:)`

---

<div class="post-metadata">

**Author:** ![Peace](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@Peace](https://discourse.processing.org/u/Peace)\
**Post date:** [July 13, 2021, 11:34am UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230/4 "2021-07-13T11:34:57Z")

</div>

You are a champ, may peace be upon you 💞

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 13, 2021, 12:52pm UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230/5 "2021-07-13T12:52:13Z")

</div>

Hello,

This is an example to try:

```auto
void setup()
  {
  size(300, 300);
  }

void draw()
  {
  background(0);
  int x = mouseX;
  int y = mouseY;
  
  //Text to console
  println(x, y);
  
  //Text on screen
  textSize(16);
  textAlign(CENTER);
  text(str(x) + ", " + str(y), x, y);
  }    

```

As you move the mouse around it displays the (x,y) co-ordinate on the screen and on the console.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/7273b75ff63b117d044ee8436e54ef336ce9c89d.png)

`:)`

---

<div class="post-metadata">

**Author:** ![Peace](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@Peace](https://discourse.processing.org/u/Peace)\
**Post date:** [July 13, 2021, 2:49pm UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230/6 "2021-07-13T14:49:01Z")

</div>

Thanks champ. I really appreciate your benevolence. Thanks again 💞
