Skip to content

145_Ray_Casting - optimice performance by using square distance #15

@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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions