Search completed in 1.43 seconds.
Matrix math for the web - Web APIs
this is a special transformation matrix which functions much like the number 1 does in scalar multiplication; just like n * 1 = n,
multiplying any matrix by the identity matrix gives a resulting matrix whose values match the original matrix.
... the identity matrix looks like this in javascript: let identitymatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; what does
multiplying by the identity matrix look like?
... the easiest example is to
multiply a single point by the identity matrix.
...And 13 more matches
WebGL constants - Web APIs
src_color 0x0300 passed to blendfunc or blendfuncseparate to
multiply a component by the source elements color.
... one_minus_src_color 0x0301 passed to blendfunc or blendfuncseparate to
multiply a component by one minus the source elements color.
... src_alpha 0x0302 passed to blendfunc or blendfuncseparate to
multiply a component by the source's alpha.
...And 7 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
composing multiple transforms if your camera needs to be performing multiple transforms simultaneously, such as zooming and panning at the same time, you can
multiply the transform matrices together to compose them into a single matrix that applies both changes at once.
... see
multiplying two matrices in the article matrix math for the web for a clear but readable function that does this or use your preferred matrix math library such as glmatrix to do the work.
... it's crucial to remember that unlike typical arithmetic, where multiplication is commutative (that is, you get the same answer whether you
multiply left to right or right to left), matrix multiplication is not commutative!
...And 6 more matches
Functions - JavaScript
// the following variables are defined in the global scope var num1 = 20, num2 = 3, name = 'chamahk'; // this function is defined in the global scope function
multiply() { return num1 * num2; }
multiply(); // returns 60 // a nested function example function getscore() { var num1 = 2, num2 = 3; function add() { return name + ' scored ' + (num1 + num2); } return add(); } getscore(); // returns "chamahk scored 5" scope and the function stack recursion a function can refer to and call itself.
...
multiply-nested functions functions can be
multiply-nested.
... in the following example, if no value is provided for b, its value would be undefined when evaluating a*b, and a call to
multiply would normally have returned nan.
...And 5 more matches
WebGL model view projection - Web APIs
the final benefit of using homogeneous coordinates is that they fit very nicely for
multiplying against 4x4 matrices.
...it uses custom functions to create and
multiply matrices as defined in the mdn webgl shared code.
... the new function looks like this: cubedemo.prototype.computemodelmatrix = function(now) { //scale down by 50% var scale = mdn.scalematrix(0.5, 0.5, 0.5); // rotate a slight tilt var rotatex = mdn.rotatexmatrix(now * 0.0003); // rotate according to time var rotatey = mdn.rotateymatrix(now * 0.0005); // move slightly down var position = mdn.translatematrix(0, -0.1, 0); //
multiply together, make sure and read them in opposite order this.transforms.model = mdn.
multiplyarrayofmatrices([ position, // step 4 rotatey, // step 3 rotatex, // step 2 scale // step 1 ]); }; in order to use this in the shader it must be set to a uniform location.
...And 3 more matches
<blend-mode> - CSS: Cascading Style Sheets
<div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: normal; }
multiply the final color is the result of
multiplying the top and bottom colors.
... <div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode:
multiply; } screen the final color is the result of inverting the colors,
multiplying them, and inverting that value.
... <div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: screen; } overlay the final color is the result of
multiply if the bottom color is darker, or screen if the bottom color is lighter.
...And 3 more matches
mix-blend-mode - CSS: Cascading Style Sheets
syntax /* keyword values */ mix-blend-mode: normal; mix-blend-mode:
multiply; mix-blend-mode: screen; mix-blend-mode: overlay; mix-blend-mode: darken; mix-blend-mode: lighten; mix-blend-mode: color-dodge; mix-blend-mode: color-burn; mix-blend-mode: hard-light; mix-blend-mode: soft-light; mix-blend-mode: difference; mix-blend-mode: exclusion; mix-blend-mode: hue; mix-blend-mode: saturation; mix-blend-mode: color; mix-blend-mode: luminosity; /* global values */ mix-blend-m...
... formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax <blend-mode>where <blend-mode> = normal |
multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity examples effect of different mix-blend-mode values <div class="grid"> <div class="col"> <div class="note">blending in isolation (no blending with the background)</div> <div class="row isolate"> <div class="cell"> normal <div class="container normal"> <div class="group...
...%,100%)" /> </lineargradient> </defs> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> <div class="cell">
multiply <div class="container
multiply"> <div class="group"> <div class="item firefox"></div> <svg viewbox="0 0 150 150"> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> ...
...And 2 more matches
Default parameters - JavaScript
in the following example, if no value is provided for b when
multiply is called, b's value would be undefined when evaluating a * b and
multiply would return nan.
... function
multiply(a, b) { return a * b }
multiply(5, 2) // 10
multiply(5) // nan !
... to guard against this, something like the second line would be used, where b is set to 1 if
multiply is called with only one argument: function
multiply(a, b) { b = (typeof b !== 'undefined') ?
...And 2 more matches
Advanced styling effects - Learn web development
first, background-blend-mode — here we'll show a couple of simple <div>s, so you can compare the original with the blended version: <div> </div> <div class="
multiply"> </div> now some css — we are adding to the <div> one background image and a green background color: div { width: 250px; height: 130px; padding: 10px; margin: 10px; display: inline-block; background: url(https://mdn.mozillademos.org/files/13090/colorful-heart.png) no-repeat center 20px; background-color: green; } .
multiply { background-blend-mode:
multiply; } the result we ...
...get is this — you can see the original on the left, and the
multiply blend mode on the right: mix-blend-mode now let's look at mix-blend-mode.
... here we'll present the same two <div>s, but each one is now sat on top of a simple <div> with a purple background, to show how the elements will blend together: <article> no mix blend mode <div> </div> <div> </div> </article> <article>
multiply mix <div class="
multiply-mix"> </div> <div> </div> </article> here's the css we'll style this with: article { width: 280px; height: 180px; margin: 10px; position: relative; display: inline-block; } div { width: 250px; height: 130px; padding: 10px; margin: 10px; } article div:first-child { position: absolute; top: 10px; left: 0; background: url(https://mdn.mozillademos.org/files/13090/colorful-heart.png) no-repeat center 20px; background-color: green; } article div:last-child { background-color: pur...
...ple; position: absolute; bottom: -10px; right: 0; z-index: -1; } .
multiply-mix { mix-blend-mode:
multiply; } this gives us the following results: you can see here that the
multiply mix blend has blended together not only the two background images, but also the color from the <div> below it too.
KeyboardEvent: code values - Web APIs
0x002d "keyx" "keyx" 0x002e "keyc" "keyc" 0x002f "keyv" "keyv" 0x0030 "keyb" "keyb" 0x0031 "keyn" "keyn" 0x0032 "keym" "keym" 0x0033 "comma" "comma" 0x0034 "period" "period" 0x0035 "slash" "slash" 0x0036 "shiftright" "shiftright" 0x0037 "numpad
multiply" "numpad
multiply" 0x0038 "altleft" "altleft" 0x0039 "space" "space" 0x003a "capslock" "capslock" 0x003b "f1" "f1" 0x003c "f2" "f2" 0x003d "f3" "f3" 0x003e "f4" "f4" 0x003f "f5" "f5" 0x0040 "f6" "f6" 0x0041 "f7" "f7" 0x0042 "f8" "f8...
... "shiftright" "shiftright" kvk_rightoption (0x3d) "altright" "altright" kvk_rightcontrol (0x3e) "controlright" "controlright" kvk_function (0x3f) "fn" (no events fired actually) "" (no events fired actually) kvk_f17 (0x40) "f17" "f17" kvk_ansi_keypaddecimal (0x41) "numpaddecimal" "numpaddecimal" kvk_ansi_keypad
multiply (0x43) "numpad
multiply" "numpad
multiply" kvk_ansi_keypadplus (0x45) "numpadadd" "numpadadd" kvk_ansi_keypadclear (0x47) "numlock" "numlock" kvk_volumeup (0x48) "audiovolumeup" (was "volumeup" until firefox 48) "audiovolumeup" (was "volumeup" until chrome 50) kvk_volumedown (0x49) "audiovolumedown" (was "volumedown" until firefox 49) ...
... 0x0035 "keyx" "keyx" 0x0036 "keyc" "keyc" 0x0037 "keyv" "keyv" 0x0038 "keyb" "keyb" 0x0039 "keyn" "keyn" 0x003a "keym" "keym" 0x003b "comma" "comma" 0x003c "period" "period" 0x003d "slash" "slash" 0x003e "shiftright" "shiftright" 0x003f "numpad
multiply" "numpad
multiply" 0x0040 "altleft" "altleft" 0x0041 "space" "space" 0x0042 "capslock" "capslock" 0x0043 "f1" "f1" 0x0044 "f2" "f2" 0x0045 "f3" "f3" 0x0046 "f4" "f4" 0x0047 "f5" "f5" 0x0048 "f6" "f6" 0x0049 "f7" "f7" 0x004a "f8" "f8...
... "backquote" 0x002a "shiftleft" 0x002b "backslash" 0x002c "keyz" 0x002d "keyx" 0x002e "keyc" 0x002f "keyv" 0x0030 "keyb" 0x0031 "keyn" 0x0032 "keym" 0x0033 "comma" 0x0034 "period" 0x0035 "slash" 0x0036 "shiftright" 0x0037 "numpad
multiply" 0x0038 "altleft" 0x0039 "space" 0x003a "capslock" 0x003b "f1" 0x003c "f2" 0x003d "f3" 0x003e "f4" 0x003f "f5" 0x0040 "f6" 0x0041 "f7" 0x0042 "f8" 0x0043 "f9" 0x0044 "f10" 0x0045 "numlock" 0x0046 "scrolllock" 0...
Movement, orientation, and motion: A WebXR example - Web APIs
radians_per_degreee is the value to
multiply an angle in degrees by to convert the angle into radians.
... the time elapsed since the last frame was rendered (in seconds) is computed by subtracting the previous frame's timestamp, lastframetime, from the current time as specified by the time parameter and then
multiplying by 0.001 to convert milliseconds to seconds.
...ubematrix, // matrix to rotate yrotationfortime, // amount to rotate in radians [0, 1, 0]); // axis to rotate around (y) mat4.rotate(cubematrix, // destination matrix cubematrix, // matrix to rotate xrotationfortime, // amount to rotate in radians [1, 0, 0]); // axis to rotate around (x) } mat4.
multiply(modelviewmatrix, view.transform.inverse.matrix, cubematrix); mat4.invert(normalmatrix, modelviewmatrix); mat4.transpose(normalmatrix, normalmatrix); displaymatrix(view.projectionmatrix, 4, projectionmatrixout); displaymatrix(modelviewmatrix, 4, modelmatrixout); displaymatrix(view.transform.matrix, 4, cameramatrixout); displaymatrix(mousematrix, 4, mousematrixout); { const numc...
...with the cube's global orientation established, we then
multiply that by the inverse of the view's transform matrix to get the final model view matrix—the matrix to apply to the object to both rotate it for its animation purposes, but to also move and reorient it to simulate the viewer's motion through the space.
Using Web Workers - Web APIs
here we simply
multiply together the two numbers then use postmessage() again, to post the result back to the main thread.
...in this section we'll discuss the javascript found in our basic shared worker example (run shared worker): this is very similar to the basic dedicated worker example, except that it has two functions available handled by different script files:
multiplying two numbers, or squaring a number.
... sending messages to and from a shared worker now messages can be sent to the worker as before, but the postmessage() method has to be invoked through the port object (again, you'll see similar constructs in both
multiply.js and square.js): squarenumber.onchange = function() { myworker.port.postmessage([squarenumber.value,squarenumber.value]); console.log('message posted to worker'); } now, on to the worker.
... finally, back in the main script, we deal with the message (again, you'll see similar constructs in both
multiply.js and square.js): myworker.port.onmessage = function(e) { result2.textcontent = e.data; console.log('message received from worker'); } when a message comes back through the port from the worker, we insert the calculation result inside the appropriate result paragraph.
LIR - Archive of obsolete content
3 eqd integer double equality 74 ltd integer double less-than 75 gtd integer double greater-than 76 led integer double less-than-or-equal 77 ged integer double greater-than-or-equal 78 negi integer negate int 79 addi integer add int 80 subi integer subtract int 81 muli integer
multiply int 82 divi integer i386/64 divide int 83 modi integer modulo int - lir_modi is a hack.
...itwise-xor quad 96 lshq quad 64 bit left shift quad,2nd operand is an int 97 rshq quad 64 bit right shift quad, 2nd operand is an int 98 rshuq quad 64 bit right shift unsigned quad; 2nd operand is an int 99 negd double negate double 100 addd double add double 101 subd double subtract double 102 muld double
multiply double 103 divd double divide double 104 modd double modulo double lir_modd is just a place-holder opcode, ie.
...i integer convert double to int (no exceptions raised) 114 dasq quad 64 bit interpret the bits of a double as a quad 115 qasd double 64 bit interpret the bits of a quad as a double overflow arithmetic 116 addxovi integer add int and exit on overflow 117 subxovi integer subtract int and exit on overflow 118 mulxovi integer
multiply int and exit on overflow 119 addjovi integer add int and branch on overflow 120 subjovi integer subtract int and branch on overflow 121 muljovi integer
multiply int and branch on overflow 122 addjovq quad 64 bit add quad and branch on overflow 123 subjovq quad 64 bit subtract quad and branch on overflow softfloat 124 dlo2i ...
JavaScript basics - Learn web development
-, *, / 9 - 3; 8 * 2; //
multiply in js is an asterisk 9 / 3; assignment as you've seen already: this assigns a value to a variable.
...in the next example, we create a simple function which takes two numbers as arguments and multiplies them: function
multiply(num1,num2) { let result = num1 * num2; return result; } try running this in the console; then test with several arguments.
... for example:
multiply(4, 7);
multiply(20, 20);
multiply(0.5, 3); note: the return statement tells the browser to return the result variable out of the function so it is available to use.
Test your skills: Math - Learn web development
you will have to create four numeric values, then add the first two together, then subtract the fourth from the third, then
multiply the two secondary results together to get a result of 48.
...
multiply the results from the last two steps together, storing the result in a variable called finalresult.
...after
multiplying the two results together and formatting the result to 2 decimal places, the final result should be 10.42.
Compositing example - Web APIs
var canvas1 = document.createelement("canvas"); var canvas2 = document.createelement("canvas"); var gco = [ 'source-over','source-in','source-out','source-atop', 'destination-over','destination-in','destination-out','destination-atop', 'lighter', 'copy','xor', '
multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity' ].reverse(); var gcotext = [ 'this is the default setting and draws new shapes on top of the existing canvas content.', 'the new shape is drawn only where both the new shape and the destination ...
...a lighter picture is the result (opposite of
multiply)', 'a combination of
multiply and screen.
... dark parts on the base layer become darker, and light parts become lighter.', 'retains the darkest pixels of both layers.', 'retains the lightest pixels of both layers.', 'divides the bottom layer by the inverted top layer.', 'divides the inverted bottom layer by the top layer, and then inverts the result.', 'a combination of
multiply and screen like overlay, but with top and bottom layer swapped.', 'a softer version of hard-light.
DOMMatrixReadOnly - Web APIs
this is equivalent to
multiplying the matrix by dommatrix(-1, 0, 0, 1, 0, 0).
...this is equivalent to
multiplying the matrix by dommatrix(1, 0, 0, -1, 0, 0).
... dommatrixreadonly.
multiply() returns a new dommatrix created by computing the dot product of the source matrix and the specified matrix: a⋅b.
Key Values - Web APIs
"
multiply" [1] the numeric keypad's multiplication key, *.
... vk_
multiply (0x6a) kvk_ansi_keypad
multiply (0x43) gdk_key_kp_
multiply (0xffaa) qt::key_
multiply (0x0d7) keycode_numpad_
multiply (155) "add" [1] the numeric keypad's addition key, +.
... vk_numpad0 (0x60) - vk_numpad9 (0x69) kvk_keypad0 (0x52) - kvk_keypad9 (0x5c) gdk_key_kp_0 (0xffb0) - gdk_key_kp_9 (0xffb9) keycode_numpad_0 (144) - keycode_numpad_9 (153) [1] while older browsers used words like "add", "decimal", "
multiply", and so forth modern browsers identify these using the actual character ("+", ".", "*", and so forth).
in - SVG: Scalable Vector Graphics
html <div style="width: 420px; height: 220px;"> <svg style="width:200px; height:200px; display: inline;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="background
multiply"> <!-- this will not work.
... --> <feblend in="backgroundimage" in2="sourcegraphic" mode="
multiply"/> </filter> </defs> <image xlink:href="https://developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:url(#background
multiply);" /> </svg> <svg style="width:200px; height:200px; display: inline;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="image
multiply"> <!-- this is a workaround.
... --> <feimage xlink:href="https://developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <feblend in2="sourcegraphic" mode="
multiply"/> </filter> </defs> <circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:url(#image
multiply);"/> </svg> </div> result specifications specification status comment filter effects module level 1the definition of 'in' in that specification.
imgIContainer
flag_decode_no_pre
multiply_alpha: do not pre
multiply alpha if it is not already premultiplied in the image data.
... flag_sync_decode 0x1 flag_decode_no_pre
multiply_alpha 0x2 flag_decode_no_colorspace_conversion 0x4 flag_clamp 0x8 frame_first 0 constants for specifying various "special" frames.
nsCOMPtr versus RefPtr
hence, the interface versus concrete class rule of thumb: interfaces will never
multiply inherit from nsisupports, so they can always use be used with nscomptr without fear of breaking in the future.
... do_queryobject is templated on the argument type, so it's possible to pass in objects that
multiply inherit from nsisupports.
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
this attribute is converted to an exact sample frame offset within the buffer, by
multiplying by the buffer's sample rate and rounding to the nearest integer value.
...this attribute is converted to an exact sample frame offset within the buffer, by
multiplying by the buffer's sample rate and rounding to the nearest integer value.
DOMMatrix - Web APIs
dommatrix.
multiplyself() modifies the matrix by post-
multiplying it with the specified dommatrix.
... dommatrix.pre
multiplyself() modifies the matrix by pre-
multiplying it with the specified dommatrix.
TextEncoder.prototype.encodeInto() - Web APIs
if the behavior of your allocator is unknown, you might want to have up to two reallocation steps and make the the first reallocation step
multiply the remaining unconverted length by two instead of three.
... however, in that case, it makes sense not to implement the usual
multiplying by two of the already written buffer length, because in such a case if a second reallocation happened, it would always overallocate compared to the original length times three.the above advice assumes that you don't need to allocate space for a zero terminator.
A basic 2D WebGL animation example - Web APIs
this can be done easily enough by
multiplying by a scaling factor that's based on the context's aspect ratio.
... then the final position is computed by
multiplying the rotated position by the scaling vector provided by the javascript code in uscalingfactor.
Lighting in WebGL - Web APIs
the first thing we do is transform the normal based on the current orientation of the cube, by
multiplying the vertex's normal by the normal matrix.
...rying highp vec2 vtexturecoord; varying highp vec3 vlighting; uniform sampler2d usampler; void main(void) { highp vec4 texelcolor = texture2d(usampler, vtexturecoord); gl_fragcolor = vec4(texelcolor.rgb * vlighting, texelcolor.a); } `; here we fetch the color of the texel, just like we did in the previous example, but before setting the color of the fragment, we
multiply the texel's color by the lighting value to adjust the texel's color to take into account the effect of our light sources.
WebGL best practices - Web APIs
useprogram(prog1) <pipeline flush> bindframebuffer(target) drawarrays() bindtexture(webgl_texture) -teximage2d(htmlvideoelement): +useprogram(_internal_tex_tranform_prog) <pipeline flush> +bindframebuffer(webgl_texture._internal_framebuffer) +bindtexture(htmlvideoelement._internal_video_tex) +drawarrays() // y-flip/colorspace-transform/alpha-(un)pre
multiply +bindtexture(webgl_texture) +bindframebuffer(target) +useprogram(prog1) <pipeline flush> drawarrays() ...
... bindtexture(webgl_texture) -teximage2d(htmlvideoelement): +useprogram(_internal_tex_tranform_prog) <pipeline flush> +bindframebuffer(webgl_texture._internal_framebuffer) +bindtexture(htmlvideoelement._internal_video_tex) +drawarrays() // y-flip/colorspace-transform/alpha-(un)pre
multiply +bindtexture(webgl_texture) +bindframebuffer(target) useprogram(prog1) <pipeline flush> bindframebuffer(target) drawarrays() bindtexture(webgl_texture) drawarrays() ...
self.createImageBitmap() - Web APIs
pre
multiplyalpha: specifies whether the bitmap's color channels should be premultiplied by the alpha channel.
... one of none, pre
multiply, or default (default).
XRReferenceSpaceEvent.transform - Web APIs
examples this example handles the reset event by walking through all the objects in a scene, updating each object's position by
multiplying it with the event's given transform.
... xrreferencespace.addeventlistener("reset", event => { for (let obj of scene.objects) { mat4.
multiply(obj.transform, obj.transform, event.transform); } }); specifications specification status comment webxr device apithe definition of 'xrreferencespaceevent.transform' in that specification.
XRRigidTransform.inverse - Web APIs
examples in this example, the model view matrix for an object is computed by taking the view matrix and
multiplying it by the object's pose matrix.
...*/ mat4.
multiply(modelviewmatrix, view.transform.inverse.matrix, objectmatrix); gl.uniformmatrix4fv(programinfo.uniformlocations.modelviewmatrix, false, modelviewmatrix); /* ...
XRView.transform - Web APIs
const modelviewmatrix = mat4.create(); const normalmatrix = mat4.create(); for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); for (let obj of world.objects) { mat4.
multiply(modelviewmatrix, view.transform.inverse.matrix, obj.matrix); mat4.invert(normalmatrix, modelviewmatrix); mat4.transpose(normalmatrix, normalmatrix); obj.render(modelviewmatrix, normalmatrix); } } two matrices are created outside the rendering loop; this avoids repeatedly allocating and deallocating the matrices, and generally reduces overhead by reusing the same matrix for each o...
...each object's model view matrix is computed by
multiplying its own matrix which describes the object's own position and orientation by the additional position and orientation adjustments needed to match the camera's movement.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
the static method xrwebgllayer.getnativeframebufferscalefactor() returns a floating-point scaling factor by which one can
multiply the specified xrsession's resolution to get the native resolution of the webxr device's frame buffer.
...in any case,
multiplying the recommended resolution as identified by the xrsession by this value will result in the actual native resolution of the xr hardware.
Functions - JavaScript
expression compare the following: a function defined with the function constructor assigned to the variable
multiply: var
multiply = new function('x', 'y', 'return x * y'); a function declaration of a function named
multiply: function
multiply(x, y) { return x * y; } // there is no semicolon here a function expression of an anonymous function assigned to the variable
multiply: var
multiply = function(x, y) { return x * y; }; a function expression of a function named func_name assigned to the varia...
...ble
multiply: var
multiply = function func_name(x, y) { return x * y; }; differences all do approximately the same thing, with a few subtle differences: there is a distinction between the function name and the variable the function is assigned to.
Visualizing an audio spectrum - Archive of obsolete content
fbl; i++ ) { // assuming interlaced stereo channels, // need to split and merge into a stero-mix mono signal signal[i] = (fb[2*i] + fb[2*i+1]) / 2; } fft.forward(signal); // clear the canvas before drawing spectrum ctx.clearrect(0,0, canvas.width, canvas.height); for (var i = 0; i < fft.spectrum.length; i++ ) { //
multiply spectrum by a zoom value magnitude = fft.spectrum[i] * 4000; // draw rectangle bars for each frequency bin ctx.fillrect(i * 4, canvas.height, 3, -magnitude); } } var audio = document.getelementbyid('audio-element'); audio.addeventlistener('mozaudioavailable', audioavailable, false); audio.addeventlistener('loadedmetadata', loadedmeta...
confirm - Archive of obsolete content
the value is calculated by
multiplying the corresponding button position constant with a button title constant for each button, then adding the results and any additional options (see other constants).
Keyboard Shortcuts - Archive of obsolete content
vk_b vk_c vk_d vk_e vk_f vk_g vk_h vk_i vk_j vk_k vk_l vk_m vk_n vk_o vk_p vk_q vk_r vk_s vk_t vk_u vk_v vk_w vk_x vk_y vk_z vk_numpad0 vk_numpad1 vk_numpad2 vk_numpad3 vk_numpad4 vk_numpad5 vk_numpad6 vk_numpad7 vk_numpad8 vk_numpad9 vk_
multiply vk_add vk_separator vk_subtract vk_decimal vk_divide vk_f1 vk_f2 vk_f3 vk_f4 vk_f5 vk_f6 vk_f7 vk_f8 vk_f9 vk_f10 vk_f11 vk_f12 vk_f13 vk_f14 vk_f15 vk_f16 vk_f17 vk_f18 vk_f19 vk_f20 vk_f21 vk_f22 vk_f23 vk_f24 vk_num_lock vk_scroll_lock vk_comma vk_p...
Displaying a graphic with audio samples - Archive of obsolete content
tereo channels, // need to split and merge into a stero-mix mono signal signal[i] = (fb[2*i] + fb[2*i+1]) / 2; } // clear the canvas before drawing spectrum ctx.fillstyle = "rgb(0,0,0)"; ctx.fillrect (0,0, canvas.width, canvas.height); ctx.fillstyle = "rgb(255,255,255)"; for (var i = 0; i < signal.length; i++ ) { //
multiply spectrum by a zoom value magnitude = signal[i] * 1000; // draw rectangle bars for each frequency bin ctx.fillrect(i * 4, canvas.height, 3, -magnitude); } ctx.drawimage(document.getelementbyid('mozlogo'),0,0, canvas.width, canvas.height); } var audio = document.getelementbyid('audio-element'); audio.addeventlistener('mozau...
GLSL Shaders - Game development
the vertex shader code let's continue by writing a simple vertex shader — add the code below inside the body's first <script> tag: void main() { gl_position = projectionmatrix * modelviewmatrix * vec4(position.x+10.0, position.y, position.z+5.0, 1.0); } the resulting gl_position is calculated by
multiplying the model-view and the projection matrices by each vector to get the final vertex position, in each case.
Video and Audio APIs - Learn web development
the length we should set the inner <div> to is worked out by first working out the width of the outer <div> (any element's clientwidth property will contain its length), and then
multiplying it by the htmlmediaelement.currenttime divided by the total htmlmediaelement.duration of the media.
MathML Demo: <mtable> - tables and matrices
and making floating elements do a multiplication such as the following one which is anchored at a baseline is made simple by using align="baseline1" on both tables [ a b c d ] [ a b c d ] to
multiply a matrix a by a vector x, each row of the matrix has to be multiplied to the vector.
BloatView
the bloat number is a metric determined by
multiplying the total number of objects allocated of a given class by the class size.
nss tech note6
responding libfreebl_32int_3.chk on the 64-bit solaris sparc architecture, there are 2 freebl libraries : libfreebl_64int_3.so for ultrasparc t1 cpus, with a corresponding libfreebl_64int_3.chk libfreebl_64fpu_3.so for other ultrasparc cpus, with a corresponding libfreebl_64fpu_3.chk on the 32-bit hp-ux pa-risc architecture, there are 2 freebl libraries : libfreebl_32fpu_3.sl for cpus that do
multiply operations faster in floating point, with a corresponding libfreebl_32fpu_3.chk libfreebl_32int_3.sl for other pa-risc cpus, with a corresponding libfreebl_32int_3.chk on the 64-bit hp-ux pa-risc architecture, there is only one freebl library, called libfreebl3.sl, with a corresponding libfreebl3.chk applications should always use nss binaries that are the output of the regular nss build proc...
Redis Tips
as a conservative calculation, i
multiply all the bytes i think i might store and
multiply by 10, which antirez once recommended as a worst-case factor for data structure overhead.
Starting WebLock
on windows or linux, for example, it is possible to
multiply a print64 by a long like this: print64 x = 1, y = 2; y = x * 2; however, this same snippet will not compile on a platform like macintosh os 9, where you need to use macros to perform the calculation: print64 x, y, two; ll_i2l(x, 1); ll_i2l(y, 2); ll_i2l(two, 2); ll_mul(y, x, two); a full listing of nspr's long long support can be found at http://www.mozilla.org/projects/nspr/.
RefPtr
note: in the above example, "nscomptr<nsfoo>" might compile and work ok (it won't if your xpcom class
multiply-inherits nsisupports).
Using the clipboard
now that we have the object to copy, a transferring object needs to be created: var str = "text to copy"; var trans = transferable(sourcewindow); trans.adddataflavor("text/unicode"); // we
multiply the length of the string by 2, since it's stored in 2-byte utf-16 // format internally.
Animation.playbackRate - Web APIs
ake.addeventlistener("touchstart", growalice, false); in another example, the red queen's race game, alice and the red queen are constantly slowing down: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.playbackrate *= .9; } }, 3000); but clicking or tapping on them causes them to speed up by
multiplying their playbackrate: var gofaster = function() { redqueen_alice.playbackrate *= 1.1; } document.addeventlistener("click", gofaster); document.addeventlistener("touchstart", gofaster); specifications specification status comment web animationsthe definition of 'animation.playbackrate' in that specification.
DOMMatrixReadOnly.flipX() - Web APIs
syntax dommatrix.flipx() return value returns a dommatrix containing a new matrix being the result of the original matrix flipped about the x-axis, which is equivalent to
multiplying the matrix by dommatrix(-1, 0, 0, 1, 0, 0).
SVGTransformList - Web APIs
consolidate() svgtransform consolidates the list of separate svgtransform objects by
multiplying the equivalent transformation matrices together to result in a list consisting of a single svgtransform object of type svg_transform_matrix.
WebGLRenderingContext.getParameter() - Web APIs
mask gluint gl.stencil_writemask gluint gl.subpixel_bits glint gl.texture_binding_2d webgltexture or null gl.texture_binding_cube_map webgltexture or null gl.unpack_alignment glint gl.unpack_colorspace_conversion_webgl glenum gl.unpack_flip_y_webgl glboolean gl.unpack_pre
multiply_alpha_webgl glboolean gl.vendor domstring gl.version domstring gl.viewport int32array (with 4 elements) webgl 2 you can query the following pname parameters when using a webgl2renderingcontext.
WebGLRenderingContext.pixelStorei() - Web APIs
glboolean false true, false webgl gl.unpack_pre
multiply_alpha_webgl multiplies the alpha channel into the other color channels glboolean false true, false webgl gl.unpack_colorspace_conversion_webgl default color space conversion or no color space conversion.
Lighting a WebXR setting - Web APIs
the effect of ambient light is computed by simply
multiplying the intensity of the light source by the reflectance of the surface at the pixel's location.
Using the Web Animations API - Web APIs
we use updateplaybackrate() instead of setting the playbackrate directly since that produces a smooth update: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * .9); } }, 3000); but urging them on by clicking or tapping causes them to speed up by
multiplying their playbackrate: var gofaster = function() { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * 1.1); } document.addeventlistener("click", gofaster); document.addeventlistener("touchstart", gofaster); the background elements also have playbackrates that are impacted when you click or tap.
Visualizations with Web Audio API - Web APIs
however, we are also
multiplying that width by 2.5, because most of the frequencies will come back as having no audio in them, as most of the sounds we hear every day are in a certain lower frequency range.
Web Audio API - Web APIs
a common modification is
multiplying the samples by a value to make them louder or quieter (as is the case with gainnode).
XRRigidTransform.matrix - Web APIs
-qzqw)2(qxqz+qyqw)02(qxqy+qzqw)1-2(qx2+qz2)2(qyqz-qxqw)02(qxqz-qyqw)2(qyqz+qxqw)1-2(qx2+qy2)00001]\begin{bmatrix} 1 - 2(q_y^2 + q_z^2) & 2(q_xq_y - q_zq_w) & 2(q_xq_z + q_yq_w) & p_x\\ 2(q_xq_y + q_zq_w) & 1 - 2(q_x^2 + q_z^2) & 2(q_yq_z - q_xq_w) & p_y\\ 2(q_xq_z - q_yq_w) & 2(q_yq_z + q_xq_w) & 1 - 2(q_x^2 + q_y^2) & p_z\\ 0 & 0 & 0 & 1 \end{bmatrix} the final transform matrix is calculated by
multiplying the translation matrix by the rotation matrix, in the order (translation * rotation).
XRView - Web APIs
model view matrix the model view matrix is a matrix which defines the position of an object relative to the space in which it's located: if objectmatrix is a transform applied to the object to provide its basic position and rotation, then the model view matrix can be computed by
multiplying the object's matrix by the inverse of the view transform matrix, like this: mat4.
multiply(modelviewmatrix, view.transform.inverse.matrix, objectmatrix); normal matrix the model view's normal matrix is used when lighting the scene, in order to transform each surface's normal vectors to ensure that the light is reflected in the correct direction given the orientation and position of the surfa...
background-blend-mode - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <blend-mode>#where <blend-mode> = normal |
multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity examples <div id="div"></div> <select id="select"> <option>normal</option> <option>
multiply</option> <option selected>screen</option> <option>overlay</option> <option>darken</option> <option>lighten</option> <opti...
Expressions and operators - JavaScript
~ - + ++ -- typeof void delete
multiply/divide * / % addition/subtraction + - bitwise shift << >> >>> relational < <= > >= in instanceof equality == != === !== bitwise-and & bitwise-xor ^ bitwise-or | logical-and && logical-or || conditional ?: assignment = += -= *= /= %= <<= >>= >>>= &= ^= |= &&= ||= ?
Rest parameters - JavaScript
each one of them is then multiplied by the first parameter, and the array is returned: function
multiply(multiplier, ...theargs) { return theargs.map(element => { return multiplier * element }) } let arr =
multiply(2, 1, 2, 3) console.log(arr) // [2, 4, 6] use with the arguments object array methods can be used on rest parameters, but not on the arguments object: function sortrestargs(...theargs) { let sortedargs = theargs.sort() return sortedargs } console.log(sortrestargs(5, 3, ...
Array.prototype.reduce() - JavaScript
nsole.log) // 1200 function composition enabling piping // building-blocks to use for composition const double = x => x + x const triple = x => 3 * x const quadruple = x => 4 * x // function composition enabling pipe functionality const pipe = (...functions) => input => functions.reduce( (acc, fn) => fn(acc), input ) // composed functions for multiplication of specific values const
multiply6 = pipe(double, triple) const
multiply9 = pipe(triple, triple) const
multiply16 = pipe(quadruple, quadruple) const
multiply24 = pipe(double, triple, quadruple) // usage
multiply6(6) // 36
multiply9(9) // 81
multiply16(16) // 256
multiply24(10) // 240 write map using reduce if (!array.prototype.mapusingreduce) { array.prototype.mapusingreduce = function(callback, thisarg) { return t...
Math.imul() - JavaScript
multiplying two numbers stored internally as integers (which is only possible with asmjs) with imul is the only potential circumstance where math.imul may prove performant in current browsers.
Digital audio concepts - Web media technologies
the size of an audio frame is calculated by
multiplying the sample size in bytes by the number of channels, so a single frame of stereo 16-bit audio is 4 bytes long and a single frame of 5.1 floating-point audio is 24 (4 bytes per sample multiplied by 6 channels).
mode - SVG: Scalable Vector Graphics
only one element is using this attribute: <feblend> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <filter id="blending1" x="0" y="0" width="100%" height="100%"> <feflood result="floodfill" x="0" y="0" width="100%" height="100%" flood-color="seagreen" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="
multiply"/> </filter> <filter id="blending2" x="0" y="0" width="100%" height="100%"> <feflood result="floodfill" x="0" y="0" width="100%" height="100%" flood-color="seagreen" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="color-dodge"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" sty...