# p5.Vector.mult issue

**URL:** <https://discourse.processing.org/t/p5-vector-mult-issue/23108>\
**Category:** Beginners\
**Created:** [August 7, 2020, 4:41pm UTC](https://discourse.processing.org/t/p5-vector-mult-issue/23108 "2020-08-07T16:41:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![subhash](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@subhash](https://discourse.processing.org/u/subhash)\
**Post date:** [August 7, 2020, 4:41pm UTC](https://discourse.processing.org/t/p5-vector-mult-issue/23108/1 "2020-08-07T16:41:47Z")

</div>

I am trying to multiply two vectors elementwise using p5.Vector.mult(). It shows some odd behavior.  
Could you tell me what am I doing wrong?  
My code:

```auto
    let v1 = createVector(-1,1,0);
    const rot_axis = p5.Vector.mult(this.orbit_normal,v1);
    print('A');
    print(this.orbit_normal,v1);
    print('B');
    print (rot_axis);
    print('C');

```

Output:

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

Why is the mult function showing odd behavior?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 7, 2020, 6:12pm UTC](https://discourse.processing.org/t/p5-vector-mult-issue/23108/2 "2020-08-07T18:12:39Z")

</div>

Go to [OpenProcessing.org/sketch/create](http://OpenProcessing.org/sketch/create)

Then paste this example below:

```auto
function setup() {
  const v1 = createVector(
    .07059288589999414,
    .07059288589999414,
    .9950041652780257
  );

  const v2 = createVector(-1, 1, 0);

  const v3 = p5.Vector.mult(v1, v2);

  print(v1.toString(), v2.toString(), v3.toString());
}

```

You should get these 3 p5.Vector results below:  
 ![p5.Vector.mult](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/138125663936561dc549ad029ee0e11c55d7e84f.png)
