Skip to content

145_Ray_Casting - optimice performance by using square distance #15

Open
@strech345

Description

@strech345

when using dist only for compare, its better to use the square distance. Because otherwise quare-root needs to be calculated which is much more cpu heavy.

const d = p5.Vector.dist(this.pos, pt);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions