Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Mar 28, 2023

Description

It seems to be the most common term.

@sunag sunag added this to the r151 milestone Mar 28, 2023
@LeviPesin
Copy link
Contributor

LeviPesin commented Mar 28, 2023

I think it's better to remain it invert... It may be a little bit confusing with reciprocal, but it is cleaner when used in code.

@sunag
Copy link
Collaborator Author

sunag commented Mar 28, 2023

I think it's better to remain it invert... It may be a little bit confusing with reciprocal, but it is cleaner when used in code.

Hmm... I also like the term invert(). My concern is that the others popular NodesGraph use this term:

@sunag
Copy link
Collaborator Author

sunag commented Mar 28, 2023

Maybe @mrdoob has some suggestions?

@mrdoob
Copy link
Owner

mrdoob commented Mar 28, 2023

I think it's better to follow the terms used in other node editors. So OneMinus 👍

@sunag sunag merged commit 25ef6ad into mrdoob:dev Mar 28, 2023
@sunag sunag deleted the dev-one-minus branch March 28, 2023 21:42
@LeviPesin
Copy link
Contributor

Maybe we can have alias invert for oneMinus?

@sunag sunag mentioned this pull request Mar 29, 2023
@LeviPesin
Copy link
Contributor

@sunag Why we cannot have invert as an alias of oneMinus? I still think invert is cleaner when used in code.

@sunag
Copy link
Collaborator Author

sunag commented Mar 30, 2023

@sunag Why we cannot have invert as an alias of oneMinus? I still think invert is cleaner when used in code.

I think alias should be used in case of backward compatibility. I think avoid alias can should make it easier for new users and simplify the documentation. Maybe if .invert( mag = 1 ) had a value for magnitude it would already have a difference? then it wouldn't be the same, like:

const number = float( 90 )
const result = number.invert( 100 ); // result is 10 ( 100 - 90 )

// -> .invert() // default is 1

const number = float( .9 )
const result = number.invert(); // result is 0.1 ( 1.0 - 0.9 )

//

number.invert( -1 ) // for negative numbers

@LeviPesin
Copy link
Contributor

It wouldn't be invert then... Maybe then it is better to remain as it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants