Overview
Comment: | Add -[crossProductWithVector:] to OFFloatVector. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
aadec90b2f4110ecbdbe8fadd2503f78 |
User & Date: | js on 2011-06-14 19:34:49 |
Other Links: | manifest | tags |
Context
2011-06-15
| ||
21:38 | We need OFObject.h in macros.h now for of_{point,dimension,rectangle}_t. check-in: 674acc5082 user: js tags: trunk | |
2011-06-14
| ||
19:34 | Add -[crossProductWithVector:] to OFFloatVector. check-in: aadec90b2f user: js tags: trunk | |
2011-06-13
| ||
23:53 | Add of_range(). check-in: a9c38eb137 user: js tags: trunk | |
Changes
Modified src/OFFloatVector.h from [a8920f92ed] to [0701029750].
︙ | |||
96 97 98 99 100 101 102 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | - + + + + + + + + + + + + + | - (size_t)dimension; /** * \brief Returns an array of floats with the contents of the vector. * * Modifying the returned array directly is allowed and will change the vector. * |
︙ | |||
152 153 154 155 156 157 158 | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | - + - + - - - + - - + - + | * \brief Returns the dot product of the receiver and the specified vector. * * \return The dot product of the receiver and the specified vector */ - (float)dotProductWithVector: (OFFloatVector*)vector; /** |
Modified src/OFFloatVector.m from [b49ac3419e] to [a58504ec6e].
︙ | |||
234 235 236 237 238 239 240 241 242 243 244 245 246 247 | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | return description; } - (float*)cArray { return data; } - (float)magnitude { float magnitude; size_t i; magnitude = 0.0f; for (i = 0; i < dimension; i++) magnitude += data[i] * data[i]; magnitude = sqrtf(magnitude); return magnitude; } - (void)normalize { float magnitude; size_t i; magnitude = 0.0f; for (i = 0; i < dimension; i++) magnitude += data[i] * data[i]; magnitude = sqrtf(magnitude); for (i = 0; i < dimension; i++) data[i] /= magnitude; } - (void)addVector: (OFFloatVector*)vector { size_t i; if (vector->isa != isa || vector->dimension != dimension) @throw [OFInvalidArgumentException newWithClass: isa |
︙ | |||
316 317 318 319 320 321 322 | 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | - + - + - - + + + - + - - + - - + - - - + + - - - - - + + + + + + + - - - + | for (i = 0; i < dimension; i++) dotProduct += data[i] * vector->data[i]; return dotProduct; } |
︙ |