Skip to content

[p5.js 2.0+ Bug Report]: Scalar multiplication and division truncate vectors to three dimensions #8819

@sidwellr

Description

@sidwellr

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • WebGPU
  • p5.strands
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

v2.3.0-rc.1

Web browser and version

Brave 1.90.122

Operating system

Linux Mint 6.8.0-117

Steps to reproduce this

Steps:

  1. Create a vector with more than three dimensions
  2. Multiply it by a scalar
  3. Note that the result has only three dimensions; it should have the same length as the original vector

Snippet:

function setup() {
  const v=createVector(100,50,200,100, 25);
  v.mult(2);
  console.log(v.toString());
}

This should print vector[200, 100, 400, 200, 50]; instead is prints vector[200, 100, 400]. (It works correctly in version 2.2.2.)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions