You don't have to do any maths. Just use the same sizes you already have. To measure accurately you need a spoke ruler although others will I daresay say you don't need one. If you want to do it properly use a spoke ruler. You only need to do maths when you have a rim and hub and nothing else to go on but you have the old spokes to use as a measure.
ok yes maths was an exaggeration. Basically i use my bike as a commuter and id rather not take apart the wheel somewhat, to pull out a spoke to measure, to put it back, to then order the replacement spokes and nipples. To finally rebuild the wheel. If someone can tell me what i need i can order the new bits whilst still using my bike until the new parts come then spend a good day rebuilding. a voilà!