@@ -402,7 +402,33 @@ public Vector2f mult(float scalar, Vector2f product) {
402402 product .y = y * scalar ;
403403 return product ;
404404 }
405-
405+
406+ /**
407+ * Multiplies component-wise by the specified components and returns the
408+ * product as a new instance. The current instance is unaffected.
409+ *
410+ * @param x the scale factor for the X component
411+ * @param y the scale factor for the Y component
412+ * @return a new Vector2f
413+ */
414+ public Vector2f mult (float x , float y ) {
415+ return new Vector2f (this .x * x , this .y * y );
416+ }
417+
418+ /**
419+ * Multiplies component-wise by the specified components and returns the
420+ * (modified) current instance.
421+ *
422+ * @param x the scale factor for the X component
423+ * @param y the scale factor for the Y component
424+ * @return the (modified) current instance (for chaining)
425+ */
426+ public Vector2f multLocal (float x , float y ) {
427+ this .x *= x ;
428+ this .y *= y ;
429+ return this ;
430+ }
431+
406432 /**
407433 * Divides by the scalar argument and returns the quotient as a new
408434 * instance. The current instance is unaffected.
@@ -426,7 +452,33 @@ public Vector2f divideLocal(float scalar) {
426452 y /= scalar ;
427453 return this ;
428454 }
429-
455+
456+ /**
457+ * Divides component-wise by the specified components and returns the quotient
458+ * as a new instance. The current instance is unaffected.
459+ *
460+ * @param x the divisor for the X component
461+ * @param y the divisor for the Y component
462+ * @return a new Vector2f
463+ */
464+ public Vector2f divide (float x , float y ) {
465+ return new Vector2f (this .x / x , this .y / y );
466+ }
467+
468+ /**
469+ * Divides component-wise by the specified components returns the (modified)
470+ * current instance.
471+ *
472+ * @param x the divisor for the X component
473+ * @param y the divisor for the Y component
474+ * @return the (modified) current instance (for chaining)
475+ */
476+ public Vector2f divideLocal (float x , float y ) {
477+ this .x /= x ;
478+ this .y /= y ;
479+ return this ;
480+ }
481+
430482 /**
431483 * Returns the negative of the vector. The current instance is unaffected.
432484 *
0 commit comments