Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Vector.random_2D() only outputs positive values for vector components. #12

@igayara

Description

@igayara

Test script:

from p5 import *

def setup():
	size(500,500)

def draw():
	background(255)
	direction = Vector.random_2D()
	direction.magnitude *=100
	translate(width/2, height/2)
	line((0,0), (direction.x, direction.y))
	
run()

Expected behavior:
The line should point at random directions.

Actual behavior
The line only ever points toward the positive quadrant.

p5 version: 0.3.0a2
Python version: 3.6.2
Operating System: Windows 10

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions